【发布时间】:2015-03-15 00:47:37
【问题描述】:
在以下示例中:
<?php
// this code is written to test error reporting function in runtime
error_reporting(0);
echo $var = 'hex' // I have made this mistake here by my will but error reporting message still pops up.
$name = 'rex';
?>
我想在运行时关闭 php 中的错误报告。我使用了声明error_reporting(0);
但它不适用于我的版本,它尝试了以下问题php error reporint 提出的解决方案,但它不起作用。我认为这里使用了另一个版本。
我的 php 版本是 php 5.6.3。我已经检查了php doumentation 的解决方案,但我找不到答案。
我该如何解决这个问题?
【问题讨论】:
-
@symcbean 我对你说代码仍然显示错误消息,我在问这是什么原因。你读好这个问题了吗?通常它不能显示,但它仍在我的浏览器中显示。
-
@isymcbean 是否无法从 php 文件中禁用它?
-
@pentanol 文件甚至无法执行的时候。
标签: php error-reporting