Home >Backend Development >PHP Tutorial >这错误跟PHP版本有关系?

这错误跟PHP版本有关系?

WBOY
WBOYOriginal
2016-06-23 14:24:14750browse

服务器版本是5.4.3
我本机是5.3.1

Parse error: syntax error, unexpected '[', expecting ')' 
报错如下 

$userinfo = $this->getuser('getpk', [$uid], 'userinfo');//这里uid框起来就报错了

是否跟PHP版本有关系??


回复讨论(解决方案)

php5.4 [] 是 array() 的简写

PHP5.4提供了数组简短语法:


多谢。。。  看来要升级版本了 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn