2013-10-23 46 views
2

我“米试图从我的Ubuntu服务器SVN提交失败有语法错误,意想不到的“[”

$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]为了将其提交到我的服务器

回答

3

[] -short-array表示法是在PHP 5.4中引入的。某些* ix发行版仍未将此新版本引入其默认回购站。确保你的服务器使用php5.4解析这个特定的文件。在这段时间,我建议使用'旧'数组符号。

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

+0

谢谢您的回答我解决它使用数组( '$片'=>阵列($抵消,$限制)) –

0

你不能这样做。试试这个:

'$slice' => $offset . ', ' . $limit 

我想这就是你要找的。

相关问题