PHP restore_exception_handler() 函數(shù)

2018-11-18 17:51 更新

PHP restore_exception_handler() 函數(shù)


PHP Error 參考手冊(cè) 完整的 PHP Error 參考手冊(cè)

定義和用法

restore_exception_handler() 函數(shù)恢復(fù)之前的異常處理程序。

該函數(shù)用于在通過(guò) set_exception_handler() 函數(shù)改變后恢復(fù)之前的異常處理程序。

該函數(shù)總是返回 TRUE。

語(yǔ)法

restore_exception_handler()


提示和注釋

提示:之前的異常處理程序可能是在內(nèi)建的異常處理程序或用戶(hù)自定義函數(shù)中構(gòu)建的。


實(shí)例

<?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 參考手冊(cè) 完整的 PHP Error 參考手冊(cè)
以上內(nèi)容是否對(duì)您有幫助:
在線(xiàn)筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)