heredoc problem
| From: | janet at valade dot com | Date: | Sun, 02 Mar 2003 22:02:14 +0000 |
| Subject: | heredoc problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-137803@lists.php.net to get a copy of this message | ||
Can someone tell me what is wrong with the following code:
<html>
<head><title>Testing</title></head>
<body>
<?php
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
?>
</body>
</html>
This is code straight out of the PHP manual. I get the error:
Parse error: parse error, unexpected T_SL in testhere.php on line 5
I looked up T_SL and it is a token representing << so that means it just
doesn't get the <<<. Why not? I've tried all the combinations of spaces and
no space in that line that I can think of.
So, what's wrong. Undoubtedly something obvious to anyone except me.
Janet