mardi 25 juillet 2017

php Unexpected end of file [duplicate]

This question already has an answer here:

I am using php HEREDOC and I'm getting the following error

Error: Unexpected end of file

If I remove the else part of the condition the error goes away.

It doesn't make sense because it's a simple if/else

if($value === end($_POST['inputFilter'])) {

$install_text .= <<<EOD
\n\t->addField(\${$value}, {$key});
EOD;

}
else {

$install_text .= <<<EOD
\n\t->addField(\${$value}, {$key})
EOD;    

}

Aucun commentaire:

Enregistrer un commentaire