PHP 教程 PHP restore_exception_handler() 函数

atwood · 2022-03-07 11:14:28 · 热度: 27

定义和用法

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

查看更多 PHP Error 和 Logging 函数

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册