Array error in php 5.4

Viewed 4502

Short array syntax is allowed in PHP 5.4 only less... (Ctrl+F1) Checks that language features used in the source code correspond the selected language level. (i.e. traits can be used only in PHP 5.4). Desired language level is set in the project configuration (Project Settings | PHP).

2 Answers

Had the same issue as you when I upgraded my PhpStorm... So you have to check the default PHP version on your system.

PhpStorm > Preferences > Languages & Frameworks > PHP

Change the default version to 5.4 or whichever version you are using.

enter image description here

First, go to Setting > Languages & Frameworks > PHP,

Change PHP languege level to 5.4 or newer

If you have use composer, check file composer.json and edit

"require": {
    "php": ">=5.4.1"        
 }

Then, run composer update

Related