Deviorian
Новичок
Unexpected $end при множественном <<< в условии
Почему-то неправильно обрабатывается следующий код:
выдавая ошибку
Все будет нормально. В чем может быть ошибка?
Почему-то неправильно обрабатывается следующий код:
PHP:
<?
$a = 1;
$b = 1;
if ($a==$b){
$body = <<<EOV
a
EOV;
}else{
$body = <<<EOV
c
EOV;
}
echo $body;
?>
Причем, если сменить метод присваивания в else наPHP Parse error: parse error, unexpected $end in test.php on line 14
PHP:
<?
$a = 1;
$b = 1;
if ($a==$b){
$body = <<<EOV
a
EOV;
}else{
$body = 'c';
}
echo $body;
?>
. That means especially that the identifier may not be indented, and there may not be any spaces or tabs after or before the semicolon. It's also important to realize that the first character before the closing identifier must be a newline as defined by your operating system. This is \r on Macintosh for example. Closing delimiter (possibly followed by a semicolon) must be followed by a newline too.