- set_exception_handler: documentation ( source)
<?php
function handler1() {
echo "\n######### " . __FUNCTION__ . "() called #########\n";
}
function handler2() {
echo "\n######### " . __FUNCTION__ . "() called #########\n";
}
set_exception_handler('handler1');
set_exception_handler('handler2');
if(true) {
throw new Exception('x');
}
else {
new foo();
}