interface RecursiveIterator implements Iterator (View source)

Classes implementing RecursiveIterator can be used to iterate over iterators recursively.

Methods

mixed
current()

Return the current element

from  Iterator
void
next()

Move forward to next element

from  Iterator
mixed
key()

Return the key of the current element

from  Iterator
bool
valid()

Checks if current position is valid

from  Iterator
void
rewind()

Rewind the Iterator to the first element

from  Iterator
bool
hasChildren()

Returns if an iterator can be created for the current entry.

getChildren()

Returns an iterator for the current entry.

Details

mixed current()

Return the current element

Return Value

mixed

Can return any type.

void next()

Move forward to next element

Return Value

void

Any returned value is ignored.

mixed key()

Return the key of the current element

Return Value

mixed

TKey on success, or null on failure.

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.

void rewind()

Rewind the Iterator to the first element

Return Value

void

Any returned value is ignored.

bool hasChildren()

Returns if an iterator can be created for the current entry.

Return Value

bool

true if the current entry can be iterated over, otherwise returns false.

RecursiveIterator|null getChildren()

Returns an iterator for the current entry.

Return Value

RecursiveIterator|null

An iterator for the current entry.