public function getIterator(): \Iterator
    {
        if ($this->generator instanceof ArrayyRewindableGenerator) {
            return $this->generator;
        }

        $iterator = $this->getIteratorClass();

        if ($iterator === ArrayyIterator::class) {
            return new $iterator($this->getArray(), 0, static::class, false);
        }

        return new $iterator($this->getArray());
    }
public function getIterator(): \Iterator
    {
        if ($this->generator instanceof ArrayyRewindableGenerator) {
            return $this->generator;
        }

        $iterator = $this->getIteratorClass();

        if ($iterator === ArrayyIterator::class) {
            return new $iterator($this->getArray(), 0, static::class, false);
        }

        return new $iterator($this->getArray());
    }
public function getIterator ( ) : \ Iterator { if ( $ this -> generator instanceof ArrayyRewindableGenerator ) { return $ this -> generator ; } $ iterator = $ this -> getIteratorClass ( ) ; if ( $ iterator === ArrayyIterator :: class ) { return new $ iterator ( $ this -> getArray ( ) , 0 , static :: class , false ) ; } return new $ iterator ( $ this -> getArray ( ) ) ; }
Returns a new iterator, thus implementing the \Iterator interface.

@return \Iterator
<p>An iterator for the values in the array.</p>
Returns a new iterator thus implementing the \ Iterator interface .