A simple tool for displaying pretty, colorful and clear formatted PHP variables.
supported types: null boolean integer float string array object closure resource
easy installation via composer
composer require --dev bohmm/php-dumperUsing PHP dumper is easy. Enter a variable as the first parameter in the constructor.
PHP dumper allows two display modes default or inline, which can be set using the
second parameter (false = default, true = inline).
default usage:
require __DIR__ . '/path/to/autoload.php';
$variable = 'hello world';
# display default mode
$dumper = new \Bohmm\PhpDumper\Dumper($variable);
echo $dumper->dump();
# display inline mode
$dumper = new \Bohmm\PhpDumper\Dumper($variable, true);
echo $dumper->dump();or via helper functions dump or ddump:
require __DIR__ . '/path/to/autoload.php';
$variable = 'hello world';
# display the variable (default or inline mode)
dump($variable);
dump($variable, true);
# display the variable and terminate other scripts (default or inline mode)
ddump($variable);
ddump($variable, true);This software is provided "as is", without any warranty of any kind, and is used at the user's own risk. The author assumes no liability for damages resulting from the use or misuse of this package.
PHP dumper is provided under the MIT license.
