Page 1 of 1

Whats the @ sign?

Posted: Fri Apr 16, 2004 10:46 am
by [n00b]
I see the @ sign frequently at the beginning of function or variable names. None of my ebooks mention it. Whats that? :x

Thanks

Posted: Fri Apr 16, 2004 10:47 am
by magicrobotmonkey
supresses errors - not exactly good form!

Posted: Fri Apr 16, 2004 2:13 pm
by malcolmboston
yeah, the @ symbol confused me for a while too.

i still dont bother using it

Posted: Fri Apr 16, 2004 3:35 pm
by vigge89
it's good if you use a function or something, which isn't important...

Posted: Fri Apr 16, 2004 3:36 pm
by magicrobotmonkey
yea but its still not Good. Its useful, but I would never recommend it...

Posted: Fri Apr 16, 2004 3:53 pm
by Steveo31
There's ways around it, like file_exists and function_exists. Sometimes I'll use it though.

Posted: Wed May 12, 2004 11:33 am
by dave420
There aren't generic ways round it, just a couple of functions that can help in very specific circumstances. PHP5 is supposed to address this problem, allowing us to use java-style try {} catch () syntax, which is what this whole @-thing is trying to do :)

It's not the best, but it's sometimes the only way round a poorly-coded function that craps out when conditions aren't 100% as expected.

It's nowhere near as evil as eval(). That's the most evil function in existance. :)

Posted: Wed May 12, 2004 11:57 am
by Weirdan
dave420 wrote: It's nowhere near as evil as eval(). That's the most evil function in existance. :)
But useful anyway ;) For quick hacks ;)