Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
   I'm looking through the GD sample code and I'm seeing things like this:


I don't understand the "@". And I don't see a reference to it in the
manual, I suppose that's because I don't know what it's called!


Re: @some_function

Jeff schreef:
Quoted text here. Click to load it

Hi Jeff,

Yes, these short of things can be hard to find if you don't know what
they are supposed to do.

In this case: It is an error suppression mechanism.
Read more here:

Erwin Moller

Re: @some_function

Quoted text here. Click to load it

It's the error suppression operator.  Any function that has this
symbol prepended will not print an error message to the browser if it

The error suppression operator carries quite a significant performance
hit, unfortunately, so it's not really recommended for use unless you
have no alternative.  In an ideal world the way to keep error messages
appearing in the browser is to turn off error_reporting in php.ini or
your web server configuration (in Apache this can be done from
httpd.conf or from .htaccess files if they're enabled) and check the
success or otherwise of functions yourself.  The @ operator all over
the place should be considered a PHP code smell, as it indicates that
there might be problems with how the programmer is dealing with
abnormal conditions, and it certainly means you're paying a
performance cost.

Site Timeline