Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aptana marks $a = [..] as a syntax error

I'm using Aptana Studio 3 and I have the following problem:

When I type:

$return = ['success' => (validation_errors() == null) ? true : false];

Aptana marks this line as a syntax error. Any ideas on how to fix this?

like image 416
Eliya Cohen Avatar asked Dec 08 '14 13:12

Eliya Cohen


1 Answers

Set your PHP version in Aptana to >=5.4. The array syntax with [] instead of array() is relatively new and depending on the parser it will show you a syntax error or not.

Right click on your project and go to Properties. Then click the "PHP Development" menu on the left, and select "PHP 5.4.x" (or something similar)

like image 137
Liglo App Avatar answered Sep 28 '22 00:09

Liglo App