News Feed
Sections




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

Derick Rethans' Blog:
Five reasons why the shut-op operator (@) should be avoided
January 05, 2009 @ 12:09:37

Derick Rethans has posted just a few of the reasons why the "shut-up operator" (the @ symbol) should be avoided at all costs in your PHP applications.

The @-operator is often used to silence errors in noisy PHP functions'"functions that generate warnings that can not be easily prevented. [...] In those cases, there is no way how to check up-front whether the function call will not issue a warning when being called.

There are side effects to using the operator, however, including hiding legitimate errors and making debugging that much more difficult. To back up his point, he includes four other reasons to avoid the operator's use (besides the debugging issues):

  • It's slow (part 1)
  • It's slow (part 2)
  • It's slow (part 3: It generates crappier code)
  • Apfelstrudels were harmed (related to the strudel_token in the C code for the operator)
0 comments voice your opinion now!
shutup operator atsign avoid reason slow debugging error hide


blog comments powered by Disqus

Similar Posts

WebReference.com: Unary, Binary, and Ternary Operators in PHP

PHPMaster.com: Setting Custom Error Messages for Zend_Form_Element

Slawek Lukasiewicz's Blog: Throwing Exception with Type Hinting Failed

Stefan Priebsch's Blog: Turning errors into exceptions

DevShed: Error Handling in PHP - Introducing Exceptions in PHP 5


Community Events





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


configure list code laravel community wordpress release series threedevsandamaybe api framework introduction project application bugfix library podcast interview language developer

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