InfiniteIterator
class InfiniteIterator extends IteratorIterator (View source)
The InfiniteIterator allows one to infinitely iterate over an iterator without having to manually rewind the iterator upon reaching its end.
Methods
                    void
                
                
                    next()
        
                                            
                
            Moves the inner Iterator forward or rewinds it
Details
        
                            
    __construct(Traversable $iterator)
        
    
    Constructs an InfiniteIterator
        
                            Iterator|null
    getInnerIterator()
        
    
    Get the inner iterator
        
                            void
    rewind()
        
    
    Rewind to the first element
        
                            bool
    valid()
        
    
    Checks if the iterator is valid
        
                            mixed
    key()
        
    
    Get the key of the current element
        
                            mixed
    current()
        
    
    Get the current value
        
                            void
    next()
        
    
    Moves the inner Iterator forward or rewinds it