Fixing parse errors When trying to run your example I encountered these two errors immediately:
PHP Parse error: syntax error, unexpected '[' in /lib/vendor/Apigee/Usergrid/Collection.php on line 285 PHP Parse error: syntax error, unexpected '}' in /lib/vendor/Apigee/Usergrid/Collection.php on line 290 Which are caused a missing semi-colon on line 289 and attempting to create an array with [] instead of the constructor function array() on line 285. Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d72910d3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d72910d3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d72910d3 Branch: refs/pull/27/head Commit: d72910d33e4e8e2f0e454b13da6d27148cc3fe66 Parents: f368246 Author: Ben Brooks <[email protected]> Authored: Fri Feb 28 14:10:03 2014 -0800 Committer: Ben Brooks <[email protected]> Committed: Fri Feb 28 14:10:03 2014 -0800 ---------------------------------------------------------------------- sdks/php/lib/vendor/Apigee/Usergrid/Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d72910d3/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php ---------------------------------------------------------------------- diff --git a/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php b/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php index 9b49d38..6942cfb 100644 --- a/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php +++ b/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php @@ -282,11 +282,11 @@ class Collection { $data->previous = $this->previous; $data->next = $this->next; $data->cursor = $this->cursor; - $data->list=[]; + $data->list = array(); $this->reset_entity_pointer(); while ($this->has_next_entity()) { $entity = $this->get_next_entity(); - array_push($data->list, $entity->get_json()) + array_push($data->list, $entity->get_json()); } return json_encode($data); }
