Beispiel #1
0
<?php

require __DIR__ . '/../src/Vardump.php';
$fixtures = (require __DIR__ . '/_fixtures.php');
// NB! CLI mode is autodetected when running from command line
// This example forces CLI mode for display in a browser.
$dump = new Vardump();
$dump->setStylingModeCli();
$dump->dump($fixtures);
echo 'EOF';
Beispiel #2
0
<?php

require __DIR__ . '/../src/Vardump.php';
$dump = new Vardump();
try {
    throw new \Exception('Something is going on here');
} catch (\Exception $e) {
    $dump->error($e->getMessage());
    $dump->info(array('something something', 'it\'s awesome indeed'));
}
Beispiel #3
0
 function vardump_exception(\Exception $e)
 {
     $vardump = new Vardump();
     $vardump->dumpPhpException($e);
 }
<?php

require __DIR__ . '/../src/Vardump.php';
try {
    throw new \Exception('something went wrong');
} catch (\Exception $e) {
    \Vardump::singleton()->dumpPhpException($e);
}
Beispiel #5
0
<?php

require __DIR__ . '/../src/Vardump.php';
$fixtures = (require __DIR__ . '/_fixtures.php');
$dump = new Vardump();
// allow html display
$dump->setHtmlMode(true);
$dump->dump($fixtures);
Beispiel #6
0
<?php

require __DIR__ . '/../src/Vardump.php';
$dump = new Vardump();
$dump->setFlattenMode(true);
$dump->dump(array('this is line 1', 'this is line 2'));
$dump->info('this is another line', '<span style="text-decoration:underline">this is the last line</span>');
Beispiel #7
0
<?php

require __DIR__ . '/../src/Vardump.php';
$fixtures = (require __DIR__ . '/_fixtures.php');
$dump = new Vardump();
$stdClass = new \stdClass();
$stdClass->time = date('r');
$stdClass->dummy = new DummyClass();
$stdClass->dummy->a_public_array = array(1, 2, 3);
$dump->dump($stdClass);
$dump->dump(array('stdClass' => $stdClass, 'var_dump_instance' => $dump));