Ordinarily, one would expect that the unexpected T_STRING implies a missing semicolon. However, in this case, where’s the semicolon missing from??
global $lay;
$yal = eval("return '$lay';");
echo $yal . "\n";
The error is thrown in the eval, viz
Parse error: syntax error, unexpected T_STRING in ... BOGARIP.php(140) : eval()'d code on line 1
with $lay containing
$reportDate\t$heads['Account']\t$id\t$heads['Time zone']\t$heads['Campaign']\t$heads['Ad group']\t$heads['Network']\t$heads['Network (with search partners)']\t\t$heads['Ad group state']\t$heads['Campaign state']\t$heads['Impressions']\t$heads['Clicks']\t$heads['CTR']\t$heads['Avg. CPC']\t$heads['Avg. CPM']\t$heads['Cost']\t$heads['Avg. position']
Does this imply that the bug is actually in $lay or am I missing something else? Is this level of string substitution even possible?
Took @Evert’s advice and refactored. Now the format contains
and the code
…