Re: nowdocs again

From: Date: Wed, 30 Jan 2008 21:39:30 +0000
Subject: Re: nowdocs again
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-35048@lists.php.net to get a copy of this message
Andi Gutmans skrev:
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 Sdjfslk Sdfkj FOO;
+1/2 Once again thinking as a teacher... Just a few weeks into my last course I actually had students asking if there was a "single quote like equivalent to heredoc", without my prompting them whatsoever. They just thought it would be natural. I am advocating the suggestion above as having <<<'FOO' looks too much like a string and will be misleading for newbies (and ~ is a PITA to type on a Swedish keyboard...) My main concern is that is easy to miss such a small glyph. Maybe: <<<|FOO or even <<<#FOO would be an alternative? Lars Gunther

« previous php.internals (#35048) next »