- register_shutdown_function: documentation ( source)
- set_exception_handler: documentation ( source)
<?php
class Concrete5_Problems_Handler {
private static $handled = false;
public static function handleException($e) {
if(self::$handled) {
return;
}
self::$handled = true;
echo "\n######### " . __FUNCTION__ . "() called #########\n";
}
public static function handleShutdown() {
if(self::$handled) {
return;
}
self::$handled = true;
echo "\n######### " . __FUNCTION__ . "() called #########\n";
}
}
set_exception_handler('Concrete5_Problems_Handler::handleException');
register_shutdown_function('Concrete5_Problems_Handler::handleShutdown');
if(true) {
throw new Exception('x');
}
else {
new foo();
}