PHP 5.3:“...的声明应该与...的声明兼容”错误

发布于 2024-09-29 08:37:46 字数 346 浏览 8 评论 0原文

升级到 PHP 5.3 后,我的应用程序被淹没了

“...的声明应该与...的声明兼容”

样式错误。我了解这些错误的性质,但我希望禁用它们。

php.ini 中的 error_reporting 设置"E_ALL & ~ (E_NOTICE | E_DEPRECATED)",但此错误继续出现。我认为它包含在 E_STRICT 中,但我错了吗?

After having upgraded to PHP 5.3, my application was inundated with

"Declaration of ... should be compatible with that of ..."

style errors. I understand the nature of these errors, but I wish to disable them.

The error_reporting setting in php.ini is "E_ALL & ~(E_NOTICE | E_DEPRECATED)", but this error continues to show up. I assumed it was included in E_STRICT, but am I wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妄司 2024-10-06 08:37:46

这是一个 E_STRICT 错误。将 php.ini 设置更改为 E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT)...

但默认情况下应将其关闭(它不包含在 E_ALL 中)。所以如果你得到它们,那就意味着它在某个地方被打开了。问题是,在哪里?是否在文件中的任何位置声明 error_reporting(...) ?如果是这样,请检查它们。如果没有,请确保您正在编辑正确的 php.ini 文件(检查 phpinfo())...您始终可以对 E_STRICT 执行 grep 尝试找到它在哪里被打开......

It's an E_STRICT error. Change your php.ini setting to E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT)...

But it should be turned off by default (it's not included in E_ALL). So if you're getting them, that means it's being turned on somewhere. The question is, where? Do declare error_reporting(...) anywhere in your files? If so, check them. If not, then be sure you're editing the right php.ini file (check phpinfo())... You could always do a grep for E_STRICT to try to find where it's being turned on...

梦里南柯 2024-10-06 08:37:46

让我告诉你一个好的设置。

你可以修改php.ini,在这个文件中,你可以搜索一句ignore_repeated_errors = Off,你应该把off状态改为on状态。

如果您也遇到相同类型的错误,则应该设置错误级别常量。

Let me tell you a good settings.

You can change php.ini, in this file, you can search a sentence as ignore_repeated_errors = Off, you should change off state to on state.

If you also meet the same type of error, you should set Error Level Constants.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文