PHP 5.3:“...的声明应该与...的声明兼容”错误
升级到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个
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 toE_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 declareerror_reporting(...)
anywhere in your files? If so, check them. If not, then be sure you're editing the right php.ini file (checkphpinfo()
)... You could always do agrep
forE_STRICT
to try to find where it's being turned on...让我告诉你一个好的设置。
你可以修改
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 asignore_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.