- var_dump: documentation ( source)
<?php
class UberException extends Exception
{
public function __construct()
{
$refTrace = new ReflectionProperty('Exception', 'trace');
$refTrace->setAccessible(true);
$refTrace->setValue($this, array(3 => array('file' => 'data.php', 'class' => 'Uber', 'line' => 20, 'function' => 'super', 'args' => array())));
$this->file = 'test.php';
$this->line = 5;
}
}
function test() {
throw new UberException();
}
try {
test();
} catch (Exception $e) {
var_dump($e->getTrace());
throw $e;
}