Since: 1.16.0

final class Iterator implements Iterator (View source)

Methods

TValue
current()

Return the current element

TKey|null
key()

Return the key of the current element

void
next()

Move forward to next element

void
rewind()

Rewind the Iterator to the first element

bool
valid()

Checks if current position is valid

void
__wakeup()

No description

Details

final TValue current()

Return the current element

Return Value

TValue

Can return any type.

final TKey|null key()

Return the key of the current element

Return Value

TKey|null

TKey on success, or null on failure.

final void next()

Move forward to next element

Return Value

void

Any returned value is ignored.

final void rewind()

Rewind the Iterator to the first element

Return Value

void

Any returned value is ignored.

final bool valid()

Checks if current position is valid

Return Value

bool

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

final void __wakeup()

No description

Return Value

void