ຫົວຂໍ້ຫຼັກ restore_exception_handler() ຕົວເລື່ອງ PHP

Example

恢复异常处理程序:

getMessage();
 }
 function myException2($exception) {
     echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
 }
 set_exception_handler("myException1");
set_exception_handler("myException2");
restore_exception_handler();
// 抛出异常
throw new Exception("This triggers the first exception handler...");
 ?> 

以上代码的输出类似这样:

[myException1] This triggers the first exception handler...

定义和用法

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

在使用 set_exception_handler() 改变异常处理函数之后,此函数可以用于还原之前的异常处理程序。

ຄຳເຕືອນ:ການກັບຄືນຂອງຫົວຂໍ້ຫົວລະບຽບສະເພາະສາມາດເປັນຫົວຂໍ້ຫົວລະບຽບທີ່ມີຢູ່ແຕ່ກໍ່ສາມາດເປັນຫົວຂໍ້ຫົວລະບຽບທີ່ຈະກໍານົດໂດຍຜູ້ນຳໃຊ້.

ຂອງພາສານິວັນ:

restore_exception_handler();

ຂໍ້ມູນດ້ານເຕັກນິກ

ຜົນການກັບຄືນ: ມັນຈະມີການກັບຄືນ TRUE.
ຫົວຂໍ້ຫົວລະບຽບ PHP: 5.0+