This happened in a PHP script with heredoc but it could really happen anywhere. The issue was whitespace in code like this:
$variable = <<< HTML
some stuff here
$othervar
HTML;
Notice on the first line that there is extra white space after the HTML. Whitespace was a deadly killer since it isn't obvious in terms of syntax.
syntax, t_sl, php, solutionthis, heredoc, whitespace, variable, html, othervar, deadly, isn,