Boxerman Posted August 23, 2015 Share Posted August 23, 2015 (edited) Hey guys, I cant for the life of me figure this out... the below code displays an error on page: Parse error: syntax error, unexpected '[' in /var/www/config.php on line 2 Any advise as to i cant get this working? CODE: <?php return [ 'database' => 'mysql', 'connection' => [ 'mysql' => [ 'driver' => 'mysql', 'host' => 'your host', 'database' => 'your database name', 'username' => 'your username', 'password' => 'your password', ], ], 'root' => '' 'apps' => [ 'auth', 'todo', 'admin', ], 'secret' => 'this_is_secret_string', ]; Edited August 23, 2015 by Boxerman Quote Link to comment Share on other sites More sharing options...
Barand Posted August 23, 2015 Share Posted August 23, 2015 What version of PHP are you using? If it's an old version try return array( .... ) instead of return [ .... ] Quote Link to comment Share on other sites More sharing options...
Boxerman Posted August 23, 2015 Author Share Posted August 23, 2015 It's PHP 5.3.10. So the old one would not work right? Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted August 23, 2015 Solution Share Posted August 23, 2015 $a = [1,2,3] was introduced in 5.4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.