Shorthand array doesn't work on server

瘦欲@ 提交于 2019-12-04 04:20:23

问题


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)


回答1:


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


来源:https://stackoverflow.com/questions/22758996/shorthand-array-doesnt-work-on-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!