Excuse me for my ignorance, but I held a series tests, and I couldn't catch a case where it might return non-integer... maybe you were dealing with a very early and an experimental versions of php-mongo? Could you give an example of a situation where the array can be returned?