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

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

Reply via email to