Re: [RFC] Double quoted NOWDOC is HEREDOC
| From: | Felipe Pena | Date: | Fri, 28 Mar 2008 23:28:25 +0000 |
| Subject: | Re: [RFC] Double quoted NOWDOC is HEREDOC | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36666@lists.php.net to get a copy of this message | ||
2008/3/24, Marcus Boerger <helly@php.net>:
> Hello Lars,
>
> to me this makes pretty much sense on a second glance as it perfectly
> reflects what our string would do. And for someone learning 'NOWDOC',
> using "HEREDOC" seems just natural.
> So I am all +1
> Consistency and satisfying expectations rocks!
>
> marcus
+1 for same reason.
However, the patch is wrong, see below:
$foo = 'foobar';
$test = <<<"a
$foo
a;
var_dump($test);
/*
string(7) "foobar
"
*/
$test = b<<<"a"
$foo
a;
/*
Parse error: syntax error, unexpected $end
*/
Here's a possible fix:
- http://felipe.ath.cx/diff/double-quote-heredoc.diff
Regards,
Felipe Pena.