What is unexpected T_VARIABLE in PHP?

omg picture omg · Sep 23, 2009 · Viewed 271k times · Source

I get this PHP error:

Parse error: syntax error, unexpected T_VARIABLE

From this line:

$list[$i][$docinfo['attrs']['@groupby']] = $docinfo['attrs']['@count'];

Is there anything wrong with this line?

Answer

knittl picture knittl · Sep 23, 2009

There might be a semicolon or bracket missing a line before your pasted line.

It seems fine to me; every string is allowed as an array index.