class AppendIterator extends IteratorIterator (View source)

An Iterator that iterates over several iterators one after the other.

Methods

__construct()

Constructs an AppendIterator

Iterator|null
getInnerIterator()

Gets an inner iterator

void
rewind()

Rewinds the Iterator

bool
valid()

Checks validity of the current element

mixed
key()

Gets the current key

mixed
current()

Gets the current value

void
next()

Moves to the next element

void
append(Iterator $iterator)

Appends an iterator

int|null
getIteratorIndex()

Gets an index of iterators

getArrayIterator()

The getArrayIterator method

Details

__construct()

Constructs an AppendIterator

Iterator|null getInnerIterator()

Gets an inner iterator

Return Value

Iterator|null

The inner iterator for the current entry.

void rewind()

Rewinds the Iterator

Return Value

void

Any returned value is ignored.

bool valid()

Checks validity of the current element

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

mixed key()

Gets the current key

Return Value

mixed

TKey on success, or null on failure.

mixed current()

Gets the current value

Return Value

mixed

Can return any type.

void next()

Moves to the next element

Return Value

void

Any returned value is ignored.

void append(Iterator $iterator)

Appends an iterator

Parameters

Iterator $iterator

The iterator to append.

Return Value

void

int|null getIteratorIndex()

Gets an index of iterators

Return Value

int|null

The index of iterators.

ArrayIterator getArrayIterator()

The getArrayIterator method

Return Value

ArrayIterator

containing the appended iterators.