- set_exception_handler: documentation ( source)
<?php
function some_call() {
throw new Exception( 'haha' );
}
function some_catcher( Exception $excpt ) {
echo 'Got it!';
}
set_exception_handler( 'some_catcher' );
try {
some_call();
} catch ( Exception $e ) {
throw $e;
}