restore_error_handler— Restore the previouserror handlingFunction
Description
bool restore_error_handler ( void )
Change the error usingset_error_handler() After handling the function, this function can be used to restore the previous error handler (either a built-in or a user-defined function).
Return value
This function always returns TRUE.
restore_error_handler() example
If unserialize() causes an error, the original error handling function will be restored.
The above routine will output:
Invalid serialized value.
restore_exception_handler- Restore the previously definedException handlingfunction.
Description
bool restore_exception_handler ( void )
After usingset_exception_handler() to change the exception handling function, this function can be used to restore the previous exception handler (can be built-in or is a user-defined function).
Return value
This function always returns TRUE.
restore_exception_handler() function example
getMessage (); } function exception_handler_2 ( Exception $e ) { echo '[' . FUNCTION . '] ' . $e -> getMessage (); } set_exception_handler ( 'exception_handler_1' ); set_exception_handler ( 'exception_handler_2' ); restore_exception_handler (); throw new Exception ( 'This triggers the first exception handler...' ); ?>
The above routine will output:
[exception_handler_1] This triggers the first exception handler...
The above is the detailed content of php restore_error_handler() function and restore_exception_handler() function. For more information, please follow other related articles on the PHP Chinese website!