restore_exception_handler()

本页内容

PHP restore_exception_handler() 函数

Category:PHP Error 错误参考手册

定义和用法

restore_exception_handler() 函数恢复之前的异常处理程序。

该函数用于在通过 set_exception_handler() 函数改变后恢复之前的异常处理程序。

该函数总是返回 TRUE。

语法


restore_exception_handler()

提示和注释

提示:之前的异常处理程序可能是在内建的异常处理程序或用户自定义函数中构建的。


示例

<?php

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 in C:webfoldertest.php on line 4

Category:PHP Error 错误参考手册

此页面最后编辑于2022年8月17日 (星期三) 22:15。