# The InfiniteIterator class

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

## Introduction

The InfiniteIterator allows one to infinitely iterate over an iterator without having to manually rewind the iterator upon reaching its end.

## Class synopsis

class InfiniteIterator extends IteratorIterator {
/* Methods */
public __construct(Iterator `$iterator`)
public next(): void
/* Inherited methods */
public IteratorIterator::current(): mixed
public IteratorIterator::getInnerIterator(): ?Iterator
public IteratorIterator::key(): mixed
public IteratorIterator::next(): void
public IteratorIterator::rewind(): void
public IteratorIterator::valid(): bool
}

## Table of Contents

- InfiniteIterator::__construct — Constructs an InfiniteIterator
- InfiniteIterator::next — Moves the inner Iterator forward or rewinds it

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open