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