- var_dump: documentation ( source)
<?php
$test = function () {
throw new \Exception('You juicy vagina :D');
};
$canIGetException = function () {
$e = (new \Exception)->getPrevious();
var_dump($e);
};
try {
$test();
} catch (\Exception $e) {
$canIGetException();
}