Re: nowdocs again
| From: | chris# | Date: | Fri, 08 Feb 2008 00:08:18 +0000 |
| Subject: | Re: nowdocs again | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35313@lists.php.net to get a copy of this message | ||
On Wed, 30 Jan 2008 11:59:42 -0800, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> Greg Beaver wrote:
>> Dmitry Stogov wrote:
>>> The feature is very useful, however, I agree, the syntax would be
>>> better. :)
>>> The current syntax:
>>>
>>> $var = <<<'TEXT'
>>> text
>>> TEXT;
>>
>> I would like to see nowdocs. The closest equivalent in another syntax I
>> can think of is xml's CDATA. Perhaps we can borrow something similar to
>> that syntax
>>
>> $var = <<<CDATA[
>> string here
>> ]CDATA;
>
> No, please, let's not further promote CDATA abuse. Everyone seems to
> think that CDATA is some sort of binary-clean way to toss any junk they
> want into an XML file which isn't even close to being true.
>
> I don't think the 'FOO' syntax is very obvious either, but I can't think
> of a better one and if there isn't a commonly known syntax we can steal
> from another language, then making up our own, no matter what it is, is
> going to be non-obvious to a lot of people.
I won't pretend to be the brightest light bulb in the house.
But would the following make any sense?
$var = [[[HERE
Is just another idea
HERE
It's not Perl, and it's not XML. It's just HERE. :)
>
> -Rasmus
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
/////////////////////////////////////////////////////
Service provided by hitOmeter.NET internet messaging!
.