Newbie: <<<EOD causing unexpected $end [Solved]
Posted: Mon Mar 05, 2007 8:24 am
feyd | Please use
Error: Parse error: parse error, unexpected $end in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpoop\phpoop4class.php on line 10
Works fine when changed to:
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Gidday guys - a humble newbie with what is most likely a rather humble question here.
Is there anything that causes an <<<EOD call to throw an "unexpected $end" error message in PHP 5.2 apart from missing curly brackets/semicolons? I'm using the following code - as soon as I replace the EOD call with double-quotes it all works fine. Any suggestions most appreciated.
Many thanks,
- Mr CheeseCode: Select all
<?php
class testerclass {
function testerclass()
{
$page =<<<EOD
Cannot figure out what is wrong
EOD;
}
}
?>Works fine when changed to:
Code: Select all
<?php
class testerclass {
function testerclass()
{
$page = "Cannot figure out what is wrong";
}
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]