Page 1 of 1
@ question
Posted: Tue Sep 11, 2007 3:52 am
by handras
What is "@" mean in front of PHP functions?
Code: Select all
$im = @imagecreatefromwbmp($imgname);
Thanx

Posted: Tue Sep 11, 2007 4:45 am
by n00b Saibot
it is used to suppress error & warning messages originating from the respective function.
Posted: Tue Sep 11, 2007 5:43 am
by CoderGoblin
It is frequently used to hide error messages but is not a good idea in the long run. Code should be developed showing all errors. In a final production environment you may want to hide things but hiding things may lead to bugs which are very hard to track down.
Posted: Tue Sep 11, 2007 6:20 am
by s.dot
In general practice, it should not be used. You can almost always catch errors in if() statements. There are a few exceptions, however.