时间:2021-07-01 10:21:17 帮助过:4人阅读
function onError($errCode, $errMesg, $errFile, $errLine) { echo "Error Occurred\n"; throw new Exception($errMesg); } function onException($e) { echo $e->getMessage(); } set_error_handler("onError"); set_exception_handler("onException"); try { $mm=0/0; echo $mm; } catch (Exception $e) { echo $e->getCode()."\n"; echo $e->getMessage()."\n"; }