X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP restore_exception_handler() Function

PHP Error PHP Error Reference

Example

Restore exception handler example:

<?php
// 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...");
?>

The above code will output something like this:

[myException1] This triggers the first exception handler...


Definition and Usage

The restore_exception_handler() function restores the previous exception handler.

This function is used to restore the previous exception handler after changing it with the set_exception_handler() function.

Tip: The previous exception handler could be the built-in exception handler or a user-defined exception handler function.


Syntax

restore_exception_handler();

Technical Details

Return Value: Always TRUE
PHP Version: 5.0+


PHP Error PHP Error Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook