Question

I'm testing Kohana AutoModeler, but I think it is an PHP lack of knowledge.

I have just set it up and got this error ErrorException [ Parse Error ]: syntax error, unexpected '[' in /classes/context/user/add/factory.php.

When I open the file, Dreamweaver did not recognize this line protected $_data = []; and this line public function __construct(array $data = []) probably because of [].

In fact I did not find what is the meaning of $var = [] or how could a resolve this.

Any help you'd be appreciated

Was it helpful?

Solution

This syntax is valid only in PHP 5.4+, in earlier versions it should be $_data = array();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top