0
$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

Kavvson Empcraft
  • 445
  • 7
  • 32
  • Making only the first part into `$query_var = array()` is not enough, `array_keys($activeFilters)[$i]` will still throw an error – function array dereferencing is also a feature introduced with PHP 5.4 – CBroe Jul 21 '15 at 22:32
  • http://php.net/manual/en/migration54.new-features.php – Jared Farrish Jul 21 '15 at 22:32
  • @Rizier123 lol i marked as that dupe then removed it, its not really a dupe of that its a php version issue –  Jul 21 '15 at 22:38
  • @Dagon I know: http://stackoverflow.com/a/29505827/3933332 PHP array dereferencing PHP 5.4; So it is a dupe – Rizier123 Jul 21 '15 at 22:40
  • 1
    @Rizier123 ok fair call, i just wanted the points ;-) –  Jul 21 '15 at 22:48

1 Answers1

0

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.