On Dec 20, 2007 4:30 PM, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:

> Just to add another perspective, PHP uses curlies inside of
> double-quoted strings to indicate various forms of
> interpolation, and it doesn't seem to cause major issues
> there.

But PHP's use of curlies is limited and context-sensitive; it's triggered by
the sequence {$ or ${.  Bare curlies don't do anything.  It's designed for
enclosing complex dereferences, e.g. an array with a literal key that's more
complex than a simple string, or that contains spaces (can't use quotes in
interpolated array indexes, just like Perl5):

"The value is {$array['a key']}" or"The value is ${array['a key']}"


"The value is {1 + 2 - 3}"   - no interpolation
"The value is {$x +$y - $z}" - syntax error because it expects the string
starting with $x to be a dereference.


Reply via email to