Thread: Changable value
View Single Post
Old 10-10-2010, 11:34 PM   #8 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
Interesting, I never knew one could do that... I do know that I will never use it though.
Absolutely the right stance to take.

A rare example of curly-brace-madness being useful comes from lovely web APIs provided by big names (here's looking at you Google and Yahoo!) which provide JSON-formatted responses containing identifiers like foo$bar or foo:bar which when converted directly to stdClass properties (via json_decode) cannot be accessed with the normal syntax (e.g. $object->foo$bar), calling for something like $object->{'foo$bar'} instead.

As for actual variables names, I can't think of the last time that I used the ${...} syntax for production code outside of a double-quoted string; I'm uncertain if it has ever happened.

Quote:
Originally Posted by delayedinsanity View Post
... I just like coming up with fictional new ways to get back ...
How about you keep this kind of stuff to yourself, next time? Thanks.
Salathe is offline  
Reply With Quote