News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Why Suppressing Notices is Wrong
December 24, 2012 @ 13:35:30

On PHPMaster.com there's a new article that suggests that suppressing notices thrown from your code is a bad practice to get into, both through error reporting and the use of the suppression operator, "@".

The PHP notice suppression operator is somewhat of a controversial topic in many circles. Some overuse it, some don't use it at all, and some don't even know it exists. Apologies in advance for the horrible code you're about to witness in this article, but it serves a purpose to illustrate the usefulness (or lack thereof) of the suppression operator.

He talks about some of the common notices and how the suppression operator prevents the "Notice" message that could come out of it. They suggest, however, that there's never a good time to use the operator, especially during development. Obviously, there are a few cases (they point out one with mail) where it could be useful. There's also some sample code for a custom error handler you can use to capture the issues that might come up.

0 comments voice your opinion now!
error notice suppression development


blog comments powered by Disqus

Similar Posts

David Stockton's Blog: Changing ErrorController to work with AJAX

PHPBuilder.com: Top 11 Best Practices for PHP Development

Pierre-Alain Joye's Blog: Howto use a single php.ini for cli/cgi with htscanner, use 0.7.0 or later

Developer Tutorials Blog: 5 essential development facts every PHP developer should know

Jonathan Snook's Blog: Easier Static Pages for CakePHP 1.2


Community Events

Don't see your event here?
Let us know!


example podcast php7 framework series install laravel5 opinion api voicesoftheelephpant extension xdebug release interview unittest language laravel community introduction library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework