In my local dev env, I use PHP Version 5.3.3-1ubuntu9.2.
Now when I see error_reporting, the value is 22527.
What is 22527?
I checked http://www.php.net/manual/en/errorfunc.constants.php, but I could not find the number.
Could anyone tell me what it is?
Do I need to change it to E_ALL | E_STRICT ?
Thanks in advance.
This value is one or more of these constants bitwise-ored together.
phpinfo()
usually displays the numeric value instead of the constants or shorthands used inside INI files. Here is an example to map the value back to constants:Output:
This value is actually bitmap mask, a sum of constants.
So, 22527 is
In your case it's
E_ALL & ~E_DEPRECATED
, it will display every error, exceptE_DEPRECATED
.PHP versions below 5.4 will also exclude
E_STRICT
errors (sinceE_STRICT
is not included inE_ALL
before that version)NEVER use the numeric value to set your error reporting, as the meaning of that value can change but the meaning of the constants (like E_ALL, E_STRICT, etc) likely will not:
(and note that as of PHP 5.4, E_ALL now includes E_STRICT)
IF you want the strictest reporting forever and ever, you could set error_reporting to a very large number in order to guarantee(?) that you will report all errors forever :
Check your php.ini for the value of error_reporting in human-readable PHP constants format. The phpinfo() function appears to always show the numeric value rather than showing the constants.
But, personally, I leave php.ini with the default values for error reporting. Instead I just put the error reporting function at the top of whatever php script I'm working on to override the defaults. e.g.: