English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
restore_exception_handler()関数は、以前に定義された例外処理関数を復元します。
bool restore_exception_handler(void);
set_exception_handler()で例外処理プログラム関数を変更した後、この関数を使用して元の例外処理プログラム(内部関数またはユーザー定義関数)に戻ることができます。
番号 | 引数および説明 |
---|---|
1 | void 引数は必要ありません |
この関数は常にTRUEを返します。
restore_exception_handler()関数の使用例:
<?php function例外処理プログラム_1(Exception $e) { echo '[' . __FUNCTION__ . '] ' . $e->getMessage(); } function例外処理プログラム_2(Exception $e) { echo '[' . __FUNCTION__ . '] ' . $e->getMessage(); } set_exception_handler('例外処理プログラム_1); set_exception_handler('例外処理プログラム_2); restore_exception_handler(); throw new Exception('これは最初の例外処理プログラムをトリガーします...'); ?>テストを試してみる ‹/›
[例外処理プログラム_1これは最初の例外処理プログラムをトリガーします...