class NoRewindIterator extends IteratorIterator (View source)

This iterator cannot be rewinded.

Methods

__construct(Traversable $iterator)

Construct a NoRewindIterator

Iterator|null
getInnerIterator()

Get the inner iterator

void
rewind()

Prevents the rewind operation on the inner iterator.

bool
valid()

Validates the iterator

TKey|null
key()

Get the current key

TValue
current()

Get the current value

void
next()

Forward to the next element

Details

__construct(Traversable $iterator)

Construct a NoRewindIterator

Parameters

Traversable $iterator

Iterator|null getInnerIterator()

Get the inner iterator

Return Value

Iterator|null

The inner iterator for the current entry.

void rewind()

Prevents the rewind operation on the inner iterator.

Return Value

void

Any returned value is ignored.

bool valid()

Validates the iterator

Return Value

bool

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

TKey|null key()

Get the current key

Return Value

TKey|null

TKey on success, or null on failure.

TValue current()

Get the current value

Return Value

TValue

Can return any type.

void next()

Forward to the next element

Return Value

void

Any returned value is ignored.