Friday, September 20, 2019

syntax error - What is unexpected T_VARIABLE in PHP?



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



There might be a semicolon or bracket missing a line before your pasted line. It seems fine to me, every string is allowed as array index.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...