Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shorthand array doesn't work on server

I'm hosting a standard website from http://www.versio.nl/ and I'm always getting the error Parse: syntax error, unexpected '['. I would have to change all the [] array notifications with array(). But is there a possiblity that I can change a setting or so? Or could it be they still work with an old version of PHP? (Looks strange to me)

like image 470
nielsv Avatar asked Dec 01 '25 10:12

nielsv


1 Answers

only php 5.4.x and up works with the new shorthand array syntax, if your server version is lower then 5.4 then there's no way to make it work, you'll need to change the syntax to the old syntax.

you could try to see the version using

echo phpinfo();
like image 183
Fadey Avatar answered Dec 04 '25 00:12

Fadey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!