意外的'[' - localhost上没有错误,但服务器上有一个[重复]

This question already has an answer here:

$query_var[] = '`'.array_keys($activeFilters)[$i].'` LIKE concat(\'%\',:'.array_keys($activeFilters)[$i].',\'%\')';

Parse error: syntax error, unexpected '['

So the following line generates an error in my Xampp apache server on localhost the error isn't occurring. Also on my server there was an error also with

$query_var = [];    

but I changed it to $query_var = array(); and the error wanst appearing it was also a unexpected [

I am nearly sure it has something to do with the PHP version or something like that

</div>

correct, its a php version issue as of php 5.4 you can use

$query_var = [];

http://php.net/manual/en/migration54.new-features.php

so your host is running an older php version.