PHP error handling functions -restore_ exception_handler()
Description
PHP restore_exception_handler function is used to restore previously defined exception handler.
Version:
PHP 5.
Syntax:
restore_exception_handler( void )
Where type of restore_exception_handler is boolean.
Parameter:
This function does not have any parameter.
Return Values:
This function always returns TRUE.
Example:
<?php
function exception_handler_1(Exception $e)
{
echo '[' . __FUNCTION__ . '] ' . $e->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...');
?>
Previous: restore_error_handler()
Next: set_error_handler()
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/error-handling/php-error-handling-function-restore_exception_handler.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics