- set_error_handler: documentation ( source)
<?php
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
$arr = array();
try {
$test = $arr['asd'];
} catch(ErrorException $exception) {
return false;
}