EasyDump is a lightweight, nice and easy way to display your PHP variables when developing. It is a nice alternative to var_dump
. It was partly inspired by (but not based on) Kint, but is way more simple.
EasuDump depends on SplFileObject, which needs PHP 5.1.0 or higher.
You only need the easydump.php
file. Just include it in your code:
require_once( 'easydump.php');
Then call the EasyDump functions:
$var = 'test';
EasyDump::debug($var); //just dump
EasyDump::debugExit($var); //exit code right after the dump
Or you can use the shortcut alias:
d($var);
de($var);
See index.php
for examples. The result would look like this:
Just change the values of the array called $config at the top of easydump.php
:
showCall
: show (or hide) the file name and line number of the current easydump callshowTime
: show the execution date and time (including microseconds)showVarNames
: show the variable names the way they were given during the EasyDump callshowSource
: show the PHP code of the call to EasyDump (useful when doing a lot of dumps)color
: the HEX color theme for display
EasyDump was thought and written to be in the public domain. This means you can do whatever you want with it without any restriction. If you need a public license, consider it as distributed under the WTFPL.
The only exception to this rule is the default color theme: it is called Earthsong and was originally created by daylerees and distributed under the MIT License.
Still, if you want to do a link to this page, it would be really appreciated :)