Function exception_handler ($ exception ){
Echo "An uncaptured exception occurred! /N ";
Echo $ exception-> getmessage ();
}
Set_exception_handler ('exception _ handler ');
Throw new exception ("-> as an example, an exception is thrown but not captured. /N ");
Echo "This statement will not be executed. /N ";
?>
/*
You can use set_exception_handler () to set the callback function for exception handling. The prototype of this function is as follows:
String set_exception_handler (callback exception_handler)
The function exception_handler () accepts a function name as a parameter. The function corresponding to this function name is called an exception handling callback function.
It has an exception but noCodeAutomatically called during capture. After being calledProgramTerminate immediately.
The Return Value of the set_exception_handler () function is the original exception handler function name or null (when an error occurs or no exception handler function exists)
*/