SVN提交失败,出现语法错误,意外的'['

2022-04-03 00:00:00 svn php tortoisesvn

我正在尝试将此代码从我的Ubuntu服务器提交到我的服务器

$me = $this->fetchAll(array('id'=>$Id,'ce'=>$e), array('cr'=>array('$slice' =>[$offset, $limit])));

但它返回

PHP Parse error:  syntax error, unexpected '[' in - on line 114
MSG: Failed to checkin branches/myFile.php, PHP said

将其提交到我的服务器'$slice' =>[$offset, $limit]有什么问题


解决方案

PHP5.4中引入了[]短数组表示法。一些*ix发行版仍然没有将这个新版本引入他们的默认版本。确保您的服务器使用php5.4来解析该特定文件。在此之前,我建议使用‘old’数组表示法。

http://www.php.net/manual/en/migration54.new-features.php

相关文章