Pierre Joye schreef:
On Jan 30, 2008 3:00 PM, Antony Dovgal <[EMAIL PROTECTED]> wrote:
On 30.01.2008 16:41, Dmitry Stogov wrote:
The final nowdoc patches are attached.
I'm going to commit them on Thursday in case of no objections.
So the current syntax is

$var = <<<'TEXT'
text
'TEXT';

am I right?

I believe it's far from readable and clear and I suggest not to add it until
we have a better syntax.

What do you suggest? :)

someone suggested this:

$s = <<<~TEXT
foo bar qux
TEXT;

which does seem more readable and/or less confusing than quoting the delimter.

or maybe use an unbalanced single quote:

$s = <<<'TEXT
foo bar qux
TEXT;

which could have a complement of

$s = <<<"TEXT
foo bar qux
TEXT;

the '"' being optional and having the same meaning as heredoc syntax as it 
stands now.

having an unbalanced quote would leave less room for someone to ask why a 
string literal
was used (because it's not a string literal without the second quote), 
additionally
using single/double quote identifiers likens the here* syntax to the behaviour 
of
single and double quoted strings with regard to variable interpolation.

just a thought.




Also looking at the discussion, I can see only 6 people involved (including 
Dmitry),
which most likely means nobody is really interested in that "nowdoc" and this is
yet another reason not to add it.

P.S. I personally see no need in such thing at all.

I'm pretty sure there is more people interested. I find nowdoc very
handy and is the perfect complement to heredoc.


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to