【发布时间】:2018-11-08 06:41:00
【问题描述】:
以下PHP代码是用PHP7运行的:
<?php
ini_set('log_errors',1);
error_reporting(0);
throw new Exception('some exception here');
?>
抛出异常,但不是'catch'-ed。
为什么没有生成“error_log”文件? error_reporting(0) 是否也抑制异常?
删除“error_reporting(0)”会按预期生成 error_log 文件。
如何仅在 error_log 中记录未捕获的异常,但使用 error_reporting(0) 抑制其他错误?
【问题讨论】:
标签: php exception php-7 error-reporting error-log