Re: I am RTFM, but still stumbling on how to get built-in functions parsed in heredoc
| From: | Eddie Drapkin | Date: | Sat, 11 Jul 2009 17:45:55 +0000 |
| Subject: | Re: I am RTFM, but still stumbling on how to get built-in functions parsed in heredoc | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295231@lists.php.net to get a copy of this message | ||
On Sat, Jul 11, 2009 at 1:41 PM, Daniel Brown<danbrown@php.net> wrote:
> On Sat, Jul 11, 2009 at 13:35, Daniel Brown<danbrown@php.net> wrote:
>>
>> It works fine because you're forcing PHP to cast 'hello' in your
>> array from a simple boolean TRUE to the string equivalent.
>
> sed "s/string equivalent/literal 'hello' string/g"
>
> (The way I'd worded it before seemed to me, upon re-reading it,
> like I was implying it would cast the boolean TRUE to the string
> 'TRUE'.)
>
> --
> </Daniel P. Brown>
> daniel.brown@parasane.net || danbrown@php.net
> http://www.parasane.net/ ||
> http://www.pilotpig.net/
> Check out our great hosting and dedicated server deals at
> http://twitter.com/pilotpig
>
If that's true, then we've found an error reporting bug! I've never
seen an error/warning raised, even with my usual
"error_reporting(E_ALL | E_STRICT | E_DEPRACATED)"! The warning is
raised here, though:
$foo = $bar[hello];
but not here:
$foo = "$bar[hello]"
At the risk of sounding like an inane ass, I quote, from php.net/strings:
"With array indices, the closing square bracket (]) marks the end of
the index. The same rules apply to object properties as to simple
variables."
Sorry if I sound like an ass, just trying to defend myself from having
to go change several thousand array items referenced from doublequotes
/ HEREDOC.