IDE display error when [(is used in a table variable

advertisements

I am using Aptana Studio 3 and it's highlighting the square brackets as a potential error. It inteferes with my coding because I keep thinking that am messing somewhere. The code is running well and no error is displayed on the console. How do I fix it?

$series_data[] = array(
    'name' => 'Brands',
    'colorByPoint' => true,
    'data'=> array(
        ['name' => 'Nairobi, KE', 'y' => 56.33],
        ['name'=> 'Kisumu, KE', 'y'=>64.03 ],
        ['name'=> 'New Yorm, USA', 'y'=>44.03 ]

The error is displayed between ( and [ as below:

data=array([


The [...] array syntax is only valid in PHP 5.4 and higher, so possibly the problem is that your IDE is configured to expect PHP 5.3 syntax? Check the IDE's config.

Also, can I recommend that you be a bit more consistent in which array syntax you use? There's nothing inherently wrong with mixing between array(...) and [...] notations, but it does make the code harder to read.