速记数组在服务器上不起作用 [英] Shorthand array doesn't work on server

查看:74
本文介绍了速记数组在服务器上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从http://www.versio.nl/托管一个标准网站,并且总是收到错误Parse: syntax error, unexpected '['.我必须用array()更改所有[]数组通知.但是我可以更改设置吗?还是它们仍然可以与旧版本的PHP一起使用? (对我来说很奇怪)

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)

推荐答案

仅php 5.4.x及更高版本可使用新的速记数组语法, 如果您的服务器版本低于5.4,则无法使其正常工作,则需要将语法更改为旧语法.

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.

您可以尝试使用

echo phpinfo();

这篇关于速记数组在服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆