PHPのrestore_exception_handler()関数
定義と使用法
restore_exception_handler()関数は、以前の例外ハンドラを復元します。
この関数は、前の例外ハンドラ後の回復を変更するset_exception_handler()関数によって使用されます。
この関数は常にTRUEを返します。
文法
restore_exception_handler()
ヒントと注意事項
ヒント:前の例外ハンドラは、例外ハンドラまたはで構築されたユーザー定義関数で構築することができます。
例
<?php
restore_exception_handler();
throw new Exception('Uncaught Exception occured');
?>
restore_exception_handler();
throw new Exception('Uncaught Exception occured');
?>
次のように上記のコードの出力は、次のとおりです。
Fatal error: Uncaught exception 'Exception' with message
'Uncaught Exception occured' in C:webfoldertest.php:4
Stack trace: #0 {main} thrown inC:webfoldertest.phpon line4
'Uncaught Exception occured' in C:webfoldertest.php:4
Stack trace: #0 {main} thrown inC:webfoldertest.phpon line4
完全なPHPのエラー・リファレンス