You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ziaratban! Thanks for reporting this. Are you running the latest version (1.9.0)? That version introduced changes to cursor iteration by implementing the Iterator interface, so that might have something to do with this. I'll investigate this and report back.
@alcaeus I believe this behavior may be expected given the implementation of Cursor::current(). return_value is only set if data is non-null, so perhaps an earlier guard statement with RETURN_NULL() is needed.
That said, @ziaratban should only call current() if valid() returns true, per PHP's own contract for the Iterator interface.
After the last fetch, the
current
method ofMongoDB\Driver\Cursor
must be returnnull
but not returns anything.(according to the doc).Test.php
output
The text was updated successfully, but these errors were encountered: