Skip to content

yosko/easydump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyDump

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.

Requirement

EasuDump depends on SplFileObject, which needs PHP 5.1.0 or higher.

Use

Dump variables

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:

Screenshot of EasyDump

Settings

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 call
  • showTime: show the execution date and time (including microseconds)
  • showVarNames: show the variable names the way they were given during the EasyDump call
  • showSource: show the PHP code of the call to EasyDump (useful when doing a lot of dumps)
  • color: the HEX color theme for display

Licence

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 :)

About

An easy, sexy and lightweight replacement to var_dump

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages