Sunday 13 January 2019

nginx - PHP syntax error, unexpected '['



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...


Answer



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'));

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...