English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP restore_exception_handler() Function Usage and Example

PHP Error & Loggings Reference Manual

The restore_exception_handler() function restores the previously defined exception handling function.

Syntax

bool restore_exception_handler(void);

Definition and Usage

After changing the exception handler function with set_exception_handler(), you can use this function to restore to the previous exception handler (which can be a built-in function or a user-defined function).

Parameter

NumberParameters and Description
1

void

No parameters required

Return Value

This function always returns TRUE.

Online Example

 Example usage of restore_exception_handler() function:

<?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 will trigger the first exception handler...');
?>
Test to see ‹/›
[exception_handler_1This will trigger the first exception handler...

PHP Error & Loggings Reference Manual