PHP-1231: PHP crashed when using selectCollection inside a Generator

https://jira.mongodb.org/browse/PHP-1231
Done