Re: nowdocs again
| From: | Gregory Beaver | Date: | Thu, 31 Jan 2008 01:01:07 +0000 |
| Subject: | Re: nowdocs again | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35053@lists.php.net to get a copy of this message | ||
Markus Fischer wrote:
> Hi,
>
> Andi Gutmans wrote:
>> I think if the syntax is confusing we can go for just a single quote as
>> part of the operator which doesn't make it look like just another plain
>> old string, e.g.:
>>
>> $bar =<<<'FOO
>
> Such a thing is not nice for casual string syntax highlighting in
> editors. Needs a special rule to handle an opening but not closing
> single quote .. mhmmm :/'
(I'll try again)
I still think it looks weird. Could we consider instead using <<<' '
with '; required on a new line?
$bar = <<<'
text
with lots of 'quotes', "Quotes"
and a few $variables, \slashes and \n \t not expanded
';
Also very clear (and more intuitive in my view) would be:
$bar = <<<'
text
with lots of 'quotes', "Quotes"
and a few $variables, \slashes and \n \t not expanded
'>>>;
Greg