Categories
josephscott

To Suppress Errors Or Not, That Is The Question

This is going to bounce around a bit, so stay close. Tim reminded me of a thread on the php-internals list about disabling the @ operator, which suppresses errors. The desire was to disable the @ operator to help track down errors. There was even a patch included.

Then Derick came to the rescue with a simple runtime solution:

error_reporting(E_ALL ^ (E_RECOVERABLE_ERROR | E_WARNING | E_NOTICE));

I haven’t tested this, but if one call to error_reporting() will do the trick, then I’m all for it.