Alex Rivera | Logout

Why not to use highest error reporting level in PHP?

Asked 2009-06-24T06:17:34.257
12

I want you to give reasons why someone should not use the highest possible error reporting level in PHP?

Ways to set highest level:

PHP < 5.4:

error_reporting(E_ALL | E_STRICT);

PHP >= 5.4:

error_reporting(E_ALL);

PHP all versions (as recommended for config files):

error_reporting(2147483647);

PHP all versions (my config, -1 will contain all errors and is easy to remember)

error_reporting(-1);

My experiences:

  • there is no reason for low reporting levels
  • never used the error control operator
  • use to convert all errors to exceptions via set_error_handler and customized exception class to overwrite file and line
Edit
Report

1 Answer

0

Well from a sys admin PoV...sometimes there is nothing you can do about the code- legacy or new. Some developers don't debug properly and a manager is going to look at you funny if you waste anyone's time with something that doesn't really matter (not sure if this will upset anyone, but if the result is the same before and after, then it doesn't really matter). I for one am very happy I can disable the notices and focus in on any real problems.

Also, this is just a shot in the dark, but maybe there is some way to do something a little fancy with this in terms of debugging by using error_log() calls.

answered 2009-06-26T04:49:13.460

Your Answer