Re: nowdocs again

From: Date: Wed, 30 Jan 2008 14:45:41 +0000
Subject: Re: nowdocs again
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-35024@lists.php.net to get a copy of this message
Pierre Joye schreef:
On Jan 30, 2008 3:00 PM, Antony Dovgal <tony@daylessday.org> 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.


« previous php.internals (#35024) next »