最近将php从5.4升级到7.0
错误处理程序停止工作。.尝试了set_exception_handler()相同的结果。 有人遇到这个问题吗?
任何帮助将不胜感激。
set_error_handler('errorHandler');
function errorHandler($errno, $errstr, $errfile, $errline) {
switch ($errno) {
case E_NOTICE:
case E_USER_NOTICE:
case E_DEPRECATED:
case E_USER_DEPRECATED:
case E_STRICT:
echo("STRICT error $errstr at $errfile:$errline n");
break;
case E_WARNING:
case E_USER_WARNING:
echo("WARNING error $errstr at $errfile:$errline n");
break;
case E_ERROR:
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
exit("FATAL error $errstr at $errfile:$errline n");
default:
exit("Unknown error at $errfile:$errline n");
}
}