PHP restore_exception_handler()函数如何使用
PHP的restore_exception_handler()函数用于恢复之前设置的异常处理函数。
使用方法以下:
function customExceptionHandler($exception) {
echo "Caught exception: " . $exception->getMessage();
}
set_exception_handler('customExceptionHandler');
throw new Exception("Something went wrong!");
restore_exception_handler();
注意事项:
TOP