-1

$router->addRoutes('', ['controller'=>'Home', 'action'=>'index']);

during compilation its generate an error

Parse error: syntax error, unexpected '['

Please help.

ARNAB
  • 69
  • 1
  • 7

1 Answers1

2

If is not >=5.4

PHP versions <= 5.4 do not support the [] syntax for array construction. Instead you shoud use array():

$router->addRoutes('',array('controller'=>'Home', 'action'=>'index'));
Dan
  • 9,804
  • 4
  • 21
  • 35
ScaisEdge
  • 129,293
  • 10
  • 87
  • 97