Iterator implementation for MongoDB\Driver\Cursor

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.9.0-rc1, 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      MongoDB\Driver\Cursor has historically only implemented Traversable and provided an internal iterator (not to be to the Iterator userland class). PHP 8 required that we implement either Iterator or IteratorAggregate directly (PHPC-1690), although PHP also provides an internal iterator for extensions to make that easier.

      That said, we should consider providing a proper Iterator implementation on the Cursor to remove our reliance on the internal iterator class for PHP 8 and present a consistent API for all supported versions.

            Assignee:
            Andreas Braun
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: