PHP 5.3: "Declaration of ... should be compatible with that of ..." error
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...
Ethan
Updated on July 20, 2022Comments
-
Ethan almost 2 years
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 inE_STRICT
, but am I wrong? -
Gordon over 13 yearsit could also be enabled by using
error_reporting(-1)
which is the recommended way of enabling all errors on development machines. -
Ethan over 13 yearsI changed the setting in php.ini, but the error still appears. It isn't set anywhere else (checked via grep) and altering the error_reporting value at runtime has no effect. Also, the line referenced in the error is always the line where the child class is declared, if this sheds any light on the problem.
-
ladenedge over 11 yearsFor completeness,
E_STRICT
is included inE_ALL
as of 5.4.