heredoc syntax: white space bug

From: Date: Tue, 09 Oct 2001 11:18:39 +0000
Subject: heredoc syntax: white space bug
Groups: php.windows 
Request: Send a blank email to php-windows+get-9760@lists.php.net to get a copy of this message
Hi y'all Thought I would share a buglet with you. In PHP 4, we now have the 'heredoc' syntax, a la Perl. Unfortunately, there is a slight bug with it. If you follow the statement-ending semi-colon with anything other than the 'return' character (even white space), you'll get a parse error at the next evaluation of the variable you assigned to the heredoc. Typically, the following won't work: $query = <<< SQL SELECT parentID FROM messages WHERE msgID = $_msgID SQL; // can't put a comment (or anything else!) here Just thought you should know - it doesn't seem to be documented...

« previous php.windows (#9760) next »