what's the difference between this @function() and function(

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
PHPHelpNeeded
Forum Commoner
Posts: 83
Joined: Mon Nov 17, 2014 8:03 pm

what's the difference between this @function() and function(

Post by PHPHelpNeeded »

Hi,

for instance I keep seeing function calls like this @socket_create(), but I also seen using regular socket_create() without the @ infront of it.

What's the difference, what does the @ do for a function call than without it?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: what's the difference between this @function() and funct

Post by requinix »

@, which is a link if that's not obvious, suppresses errors and is sometimes called the "shut-up operator". It is bad and you shouldn't use it ever* because it hides errors and that's a Bad Thing.

* Well, there are a couple - literally, like, a couple - places it's okay to use. But socket_create() is not one of them.
Post Reply