- register_shutdown_function: documentation ( source)
- set_exception_handler: documentation ( source)
<?php
function exceptionHandler() {
echo "\n######### " . __FUNCTION__ . "() called #########\n";
}
function errorHandler() {
echo "\n######### " . __FUNCTION__ . "() called #########\n";
new bar();
}
set_exception_handler('exceptionHandler');
register_shutdown_function('errorHandler');
throw new Exception('x');