Fixed PHP-723: Possibly invalid read in MongoCollection getter

This is one of the weirder functions we have
Merged pull request #356