- var_dump: documentation ( source)
- set_error_handler: documentation ( source)
<?php
function error_handler($errno, $errstr, $errfile, $errline) {
$a = func_get_args();
var_dump($a);
}
set_error_handler("error_handler");
try {
$x = new NonexistantClass();
} catch (Exception $e) {
var_dump($e->getMessage());
} catch (Error $e) {
var_dump($e);
}
echo "Don't worry, everything is still fine!\n";