-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoCollection->aggregate makes php error with pipeline operators given as arguments #114
Comments
This method should accept a variable amount of pipeline operators MongoCollection::aggregate ( array $op [, array $op [, array $... ]] ) alcaeus#114 http://www.php.net/manual/en/mongocollection.aggregate.php
This method should accept a variable amount of pipeline operators MongoCollection::aggregate ( array $op [, array $op [, array $... ]] ) #114 http://www.php.net/manual/en/mongocollection.aggregate.php
Hah, took me a while to realise this was only occuring on PHP 7, not on 5.6. I fixed it and this will be included in the upcoming 1.0.4 release. I'm waiting for feedback on #116; once that is merged I'll release a fixed version. |
Ohh, maybe we found a PHP bug? |
They intended to do the change http://php.net/manual/en/function.func-get-args.php see Example #3 |
Thanks for following up on it, good to know 👍 |
The thing is the first argument is overwritten. :(
Bad code:
Good code:
If the
func_get_args
is called after$pipeline = []
, the first value of the array will be an empty array.Test case, and pull request is in progress.
The text was updated successfully, but these errors were encountered: