<html>
<body>
// Two user-defined exception handler functions
function myException1($exception) {
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
function myException2($exception) {
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
set_exception_handler("myException1");
set_exception_handler("myException2");
restore_exception_handler();
// Throw exception
throw new Exception("This triggers the first exception handler...");
</body>
<!-- Mirrored from www.w3schools.com/php7/phptryit.asp?filename=tryphp_func_error_restore_exception_handler by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 13:40:55 GMT -->
</html>