Simple debugging methods with CLI support

v1.1.1 2023-11-04 17:10 UTC

This package is auto-updated.

Last update: 2024-04-27 17:47:43 UTC


Latest Stable Version License ci.yml

"The most effective debugging tool is still careful thought, coupled with judiciously placed print statements."

— Brian Kernighan, "Unix for Beginners" (1979)

While debugging small issues, you sometimes just want to see the contents of a variable or two. Firing up a full debugger can be overkill for quick problems, and var_dump(…); exit(1); is a little unwieldy and only accepts a single argument.

drop() is a simple debugging tool that allows you to drop one of more variable's contents in simple format that is friendly and readable on both web and CLI output.

see() is similar to drop() but it does not halt execution.


This was based on the work of my friend Jon Henderson before it was given its own repo.



require __DIR__ . '/../vendor/autoload.php';

drop(1, 2.0, "3", false, [ 1, 2.0, "3", false ]);
||||||||||||||||||||| Arg No. 0  |||||||||||||||||||||||||||||||||||||||||||


||||||||||||||||||||| Arg No. 1  |||||||||||||||||||||||||||||||||||||||||||


||||||||||||||||||||| Arg No. 2  |||||||||||||||||||||||||||||||||||||||||||


||||||||||||||||||||| Arg No. 3  |||||||||||||||||||||||||||||||||||||||||||


||||||||||||||||||||| Arg No. 4  |||||||||||||||||||||||||||||||||||||||||||

    [0] => 1
    [1] => 2
    [2] => 3
    [3] =>

||||||||||||||||||||| EOF ||||||||||||||||||||||||||||||||||||||||||||||||||


  • php: >=7.1


Install the latest version with:

composer require 'donatj/drop'


Function: \drop

function drop(...$args) : void
  • mixed $args - The arguments to expose the values of
  • never - Exit's with status 1

A helpful function to empty output buffers and take any number of arguments and expose them.

This is particularly helpful for looking into arrays and objects to see what information lies
within. This function will also kill the script after echoing the information. This function
takes any number of any typed arguments and displays them all.

Function: \see

function see(...$args) : void
  • mixed $args

A handy function to expose any number of any typed arguments while NOT killing the script
after output.