mongodb/mongo-php-driver — pull request #665 by jmikola (2014-04-08 21:50:02+00:00)
Title: PHP-1056: Limit legacy projection argument handling to numeric arrays

https://jira.mongodb.org/browse/PHP-1056

----

The "field names must be strings" exception was intended for the legacy argument style (i.e. array of field names to include). One could argue that the original code should simply have cast array values to strings for convenience, but we definitely don't need this processing for associative arrays. This does leave an edge case where the associative array is indistinguishable from a numeric array, which we cover in the included tests.

----

Note: I refactored the original `MongoCursor::__construct()` error test by splitting it into the 002 tests.