1. Go to this page and download the library: Download awesomite/var-dumper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
awesomite / var-dumper example snippets
use Awesomite\VarDumper\LightVarDumper;
$loremIpsum = <<<'LOREM_IPSUM'
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque semper justo at risus.
Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus, sed posuere libero dui id orci. Nam congue, pede vitae dapibus aliquet, elit magna vulputate arcu, vel tempus metus leo non est.
Etiam sit amet lectus quis est congue mollis. Phasellus congue lacus eget neque. Phasellus ornare, ante vitae consectetuer consequat, purus sapien ultricies dolor, et mollis pede metus eget nisi.
Praesent sodales velit quis augue. Cras suscipit, urna at aliquam rhoncus, urna quam viverra nisi, in interdum massa nibh nec erat.
LOREM_IPSUM;
$array = array(
'a' => 'a',
'ab' => 'ab',
'abc' => 'abc',
'abcd' => 'abcd',
'abcde' => 'abcde',
'abcdef' => 'abcdef',
'abcdefg' => 'abcdefg',
'abcdefgh' => 'abcdefgh',
);
$smallArray = array(1, 2.5, null, M_PI, INF);
$varDumper = new LightVarDumper();
$varDumper
->setMaxChildren(20)
->setMaxDepth(5)
->setMaxStringLength(400)
->setMaxLineLength(50)
->setIndent(' ');
$varDumper->dump(array($loremIpsum, $array, $smallArray));
use Awesomite\VarDumper\LightVarDumper;
$dumper = new LightVarDumper();
$dumper->dump(\range(1, 5));
use Awesomite\VarDumper\LightVarDumper;
$firstName = 'Mary';
$lastName = 'Watson';
$function = function ($a, $b) use ($firstName, $lastName) {
};
$dumper = new LightVarDumper();
$dumper->dump($function);
use Awesomite\VarDumper\LightVarDumper;
$dumper = new LightVarDumper();
$dumper->dump(array(
M_LOG2E,
PHP_INT_MAX,
M_PI,
));
text
array(3) {
[0] =>
string(768)
› Lorem ipsum dolor sit amet, consectetur adipiscing
› elit. Proin nibh augue, suscipit a, scelerisque
› sed, lacinia in, mi. Cras vel lorem. Etiam
› pellentesque aliquet tellus. Phasellus pharetra
› nulla ac diam. Quisque semper justo at risus.↵
› Donec venenatis, turpis vel hendrerit interdum,
› dui ligula ultricies purus, sed posuere libero dui
› id orci. Nam congue, pede vitae dapibus aliquet,
› elit magna vulpu...
[1] =>
array(8) {
[a] => “a”
[ab] => “ab”
[abc] => “abc”
[abcd] => “abcd”
[abcde] => “abcde”
[abcdef] => “abcdef”
[abcdefg] => “abcdefg”
[abcdefgh] => “abcdefgh”
}
[2] => array(5) {1, 2.5, NULL, M_PI, INF}
}