Syntax error, unexpected bracket

From Php

Jump to: navigation, search

The message syntax error, unexpected '[' can mean that you forgot the "$" on your array variable, so that the compiler couldn't figure out that it was a variable.

WRONG

 foo[5] = 7;   // missing $

RIGHT

 $foo[5] = 7;
Personal tools