@ question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
handras
Forum Newbie
Posts: 6
Joined: Wed Aug 15, 2007 4:43 am

@ question

Post by handras »

What is "@" mean in front of PHP functions?

Code: Select all

$im = @imagecreatefromwbmp($imgname);
Thanx :)
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

it is used to suppress error & warning messages originating from the respective function.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply