<?php
function errorHandler($errno, $errstr, $errfile, $errline, $errcontext) {
throw new Exception("this was an error;");
}
function exceptionHandler($e) {
echo 'exceptionHandler';
}
set_error_handler('errorHandler');
set_exception_handler('exceptionHandler');
try {
file_get_contents('foo');
} catch (Exception $e) {
echo $e->getMessage(); // exceptionHandler() not called
}
file_get_contents('foo'); // exceptionHandler() is called