Re: heredoc: change of behavoiur?

From: Date: Fri, 12 Oct 2001 15:30:02 +0000
Subject: Re: heredoc: change of behavoiur?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67861@lists.php.net to get a copy of this message
I think this is OK. I'd like to hear some other people comment. Andi At 05:28 PM 10/10/2001 +0200, jeroen@php.net wrote:
Currently, heredoc as a bit of strange behaviour in syntax of terminating it. I think it's a good idea to be a bit looser. It will make it more consistent, and allows inline use of heredoc. For BC: I really think that's no problem, but in rare cases it could lead to problems. I don't know yet wether BC alone would be showstopper for this patch. On the way this patch also solves the bug that mac-newlines are not understood (didn't see a bug report yet, but that's probably because not much people use the mac...) if there are other reasons to hold to the current syntax, please let me know. (see also: bug 13610) Patch available here: http://www.A-Eskwadraat.nl/~jeroen/php/looser_heredoc.diff which changes behaviour to: A heredoc is considered closed when the heredoc identifier appears directly after a newline. Remaining characters are allowed, provided they are invalid identifyer characters. Example: <?php mail('jeroen@php.net', 'heredoc test', <<<TEXT Hello Jeroen, Greets! TEXT, 'Cc: bla@example.com'); ?> And this works: <?php echo <<<HEREDOC bla HEREDOCUMENTATION; HEREDOC; // here the heredoc ends ?> But this doesn't: <?php echo <<<HEREDOC bla HEREDOC UMENTATION; HEREDOC; ?> for the same reason as this is: echo "bla" UMENTATION; causes a parse error. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#67861) next »