Re: heredoc problem

From: Date: Mon, 03 Mar 2003 02:37:54 +0000
Subject: Re: heredoc problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137832@lists.php.net to get a copy of this message
Hi, Monday, March 3, 2003, 8:02:14 AM, you wrote: jvc> Can someone tell me what is wrong with the following code: jvc> <html> jvc> <head><title>Testing</title></head> jvc> <body> jvc> <?php jvc> $str = <<<EOD jvc> Example of string jvc> spanning multiple lines jvc> using heredoc syntax. jvc> EOD; ?>> jvc> </body> jvc> </html> jvc> This is code straight out of the PHP manual. I get the error: jvc> Parse error: parse error, unexpected T_SL in testhere.php on line 5 jvc> I looked up T_SL and it is a token representing << so that means it just jvc> doesn't get the <<<. Why not? I've tried all the combinations of spaces jvc> and jvc> no space in that line that I can think of. jvc> So, what's wrong. Undoubtedly something obvious to anyone except me. jvc> Janet You have a space at the end of >>>EOD Get rid of it and it should work -- regards, Tom

« previous php.general (#137832) next »