--TEST-- MongoDB\Driver\Cursor segfault dumping cursor while iterating with IteratorIterator --SKIPIF-- --FILE-- insert(['_id' => 1]); $bulk->insert(['_id' => 2]); $bulk->insert(['_id' => 3]); $manager->executeBulkWrite(NS, $bulk); $query = new MongoDB\Driver\Query([], ['batchSize' => 2]); $cursor = $manager->executeQuery(NS, $query); $iterator = new IteratorIterator($cursor); $iterator->rewind(); var_dump($cursor); $iterator->next(); var_dump($cursor); $iterator->next(); var_dump($cursor); ?> ===DONE=== --EXPECTF-- object(MongoDB\Driver\Cursor)#%d (%d) {%A } object(MongoDB\Driver\Cursor)#%d (%d) {%A } object(MongoDB\Driver\Cursor)#%d (%d) {%A } ===DONE===