SVN Commit failed with syntax error, unexpected '[' [duplicate]

旧时模样 提交于 2019-12-24 01:25:20

问题


I 'm try to commit this code to my server from my Ubuntu server

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

but it return

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

what is the wrong with '$slice' =>[$offset, $limit] in order to commit it to my server


回答1:


The []-short-array notation was introduced with PHP 5.4. Some *ix distros have still not introduced this new version to their default repos. Make sure your server uses php5.4 to parse that specific file. For the time beeing I'd recommed to use the 'old' array notation.

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




回答2:


You can't do it like that. Try this:

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

I think that's what you're looking for.



来源:https://stackoverflow.com/questions/19548026/svn-commit-failed-with-syntax-error-unexpected

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