先给出官方的E文定义:
display_errors stringValue ”stderr” sends the errors to stderr instead of stdout. The value is available as of PHP 5.2.4. In earlier versions, this directive was of type boolean.
Note:
This is a feature to support your development and should never be used on production systems (e.g. systems connected to the internet).
Note:
Although display_errors may be set at runtime (with ini_set()), it won’t have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.
try {
//some throw new HXxxException();
} catch(HXxxxException $ex) {
var_dump($ex->getMessage());
}
但是异常的报错信息还是被打印在了屏幕上。我一开始还以为是xdebug的原因,我把xdebug的扩展给去了,可它还是一样的输出。最后,我通过查配置,发现了:
display_errors=On;
就试着关了一下,哈哈,没有异常的打印信息了…正常的捕获加输出…..原来
display = On
这么的霸气,捕获都无视的!!!!难怪:
This is a feature to support your development and should never be used on production systems!!!
谢谢啊,这个是你原创的吗