Typically I use E_ALL
to see anything that PHP might say about my code to try and improve it.
I just noticed a error constant E_STRICT
, but
ini_set("display_errors","2"); ERROR_REPORTING(E_ALL);
In my opinion, the higher you set the error reporting level in development phase, the better.
In a live environment, you want a slightly (but only slightly) reduced set, but you want them logged somewhere that they can't be seen by the user (I prefer syslog
).
http://php.net/error_reporting
E_ALL | E_STRICT
for development with PHP before 5.2.0.
5.2 introduces E_RECOVERABLE_ERROR
and 5.3 introduces E_DEPRECATED
and E_USER_DEPRECATED
. You'll probably want to turn those on if you're running one of those versions.
If you wanted to use magic numbers you could just set the error_reporting
value to some fairly high value of 2^n-1
- say, 16777215
, and that would really just turn on all the bits between 1..n
. But I don't think using magic numbers is a good idea...
In my opinion, PHP has dropped the ball a bit by having E_ALL
not really be all. But apparently it's going to be fixed in PHP 6...