w3resource

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()



Follow us on Facebook and Twitter for latest update.