On Sat, Jul 11, 2009 at 10:42, Ashley Sheridan<a...@ashleysheridan.co.uk> wrote:
> The braces ensure that PHP doesn't stop parsing the variable name once it
> reaches the [. By default, it will only match a variable name up to the [
> sign, so you couldn't access arrays without the braces.

    Couldn't have said it better myself.

    As for the braces in the HEREDOC around {$somevar}, while it works
absolutely fine, it was a typo on my part: I intended to show all
manner of usage and processing of variables within the HEREDOC syntax.
 However, in my own code, I generally include all variables between
{braces} when inside a HEREDOC block.  Sheer preference for
readability in a large HEREDOC: because I don't normally use curly
braces around variables, when I see that on the page, I instantly
recognize that I'm still in the block (if all other clues miraculously
fail --- and we all know that they sometimes do).

</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to