A pretty variable dumper for HTML & cli.
{
"require": {
"marmotz/dumper": "dev-master"
}
}
In most of the cases you don't need Dumper in your production environment.
{
"require-dev": {
"marmotz/dumper": "dev-master"
}
}
Include composer autoloader in your project and use dump()
function.
require_once __DIR__ . '/vendor/autoload.php';
dump($_SERVER);
You can limit the depth of the dump by using setMaxLevelOfRecursion function like this:
Marmotz\Dumper\Dump::setMaxLevelOfRecursion(5);
Dumper self-determines output type between HTML and cli.
With following code:
<?php
require_once __DIR__ . '/vendor/autoload.php';
$array = array(
1, 2, fopen(__FILE__, 'r'),
uniqid() => array(
4,
array(
uniqid() => 5, 'foobar'
),
7
),
8 => new stdClass
);
dump($array, new DateTime);
Here is an example of cli output: http://asciinema.org/a/5706
Here is an example of HTML output: