1function exception_error_handler($severity, $message, $file, $line) {
2 if (!(error_reporting() & $severity)) {
3 // This error code is not included in error_reporting
4 return;
5 }
6 throw new ErrorException($message, 0, $severity, $file, $line);
7}
8set_error_handler("exception_error_handler");