syntax error, unexpected identifier “%s”, expecting variable

Description

A foreach() structure requires a variable after the as keyword: in fact, it may be a variable, a property, a static property, an array index or the list() expression.

Example

<?php

foreach($a as b) {}

?>

Solutions

  • Add the missing $ sign, to make the identifier an array.