- set_error_handler: documentation ( source)
<?php
try {
echo $x;
}
catch(Exception $e) {
}
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");