3

I never had this happen before, but here we go:

Enter image description here

Any ideas?

  • Running php-fpm 5.3
  • Ubuntu 12.04 (Precise Pangolin)

It looks as if the comment is NOT working...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
KernelCurry
  • 1,297
  • 1
  • 13
  • 31
  • 2
    Short array syntax was introduced in PHP 5.4... use `array('as' => 'default.index', ...)` – Mark Baker Oct 06 '13 at 08:34
  • Are you sure you opened your comments properly looking at the syntax highlight it looks like you are missing the opening /* – kaning Oct 06 '13 at 08:43
  • @kaning that's a screenshot of Laravel's error page (using Symfony component), not a code editor. – abstr Oct 06 '13 at 08:59
  • 1
    You can avoid sudden errors like this by making sure your test-environment has the same installation and configuration as the production-environment! Same error confronted me when I was deploying my application on the server: local php version was 5.5 and on prod-server 5.3. – matthaeus Dec 12 '13 at 11:51

1 Answers1

7

Using [] as arrays like that only works with PHP 5.4 and up.

See PHP: Arrays

You'll have to use old array syntax for PHP 5.3.

This will work:

Route::get('/', array('as' => 'default.index', 'uses' => 'DefaultController@index'));
abstr
  • 541
  • 2
  • 5