Panasonic Youth rob sanheim writes about software, business, ruby, music, stuff and things



Posted
8 March 2007 @ 2pm

Tagged
PHP, Whining

Discuss

Gotta love the PHP

Quick - what does this line of PHP do:

@ $value = unserialize($option->option_value);

Look, its an 'at sign'. Hmm...that must be something special. I bet its some really advanced crazy PHP feat...oh of course - its PHP's error control! it tells the intrepeter to ignore any and all errors in that line of code! This warning from the docs is cool:

Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.

Thank you PHP language designers, for creating such readable, obvious code. Between the @ operator and the awesome function names, I don't know what I love more about php.


5 Comments

Posted by
Small Ventures
8 March 2007 @ 3pm

ampersand => &
at => @

Quick fix before the PHP fanboys show! LoL


Posted by
Rob
8 March 2007 @ 3pm

Good find - fixed. Thanks.

And before anyone says it, I just haven’t had time to migrate off of wordpress. Trust me, I would love to.


Posted by
Jon
20 March 2007 @ 8am

Php is still twenty zillions (approximately) times more readable than perl. And I like the way I’m always discovering new functions and even more obscure ways to use them. Today’s adventure is array_map!


Posted by
Unomi
27 March 2007 @ 1pm

I recommend to use E_STRICT for PHP and avoid to use this ‘at sign’ (or should I say abuse?).

Supressing errors can set you to some hours debugging since finding the error is a horror.

- Unomi -


Posted by
Oshuma
3 December 2007 @ 3am

Why does something like this even exist? Isn’t ignoring an error (as opposed to catching an exception) considered a really Bad Thing? Man, I really don’t miss PHP one bit.


Leave a Comment

My Command line toolkit for Ruby and Linux Reason #303 Charter Cable Sucks - Browser Hijack