The RecursiveArrayIterator class

Introduction

This iterator allows for unsetting and modifying values and keys while iterating over arrays and objects, in the same way as the ArrayIterator. Additionally, it is possible to iterate over the current iterator entry.

Class synopsis

RecursiveArrayIterator
extends ArrayIterator
implements RecursiveIterator
/* Inherited constants */
public const int ArrayIterator::STD_PROP_LIST;
public const int ArrayIterator::ARRAY_AS_PROPS;
/* Constants */
public const int RecursiveArrayIterator::CHILD_ARRAYS_ONLY;
/* Methods */
public RecursiveArrayIteratornull RecursiveArrayIterator::getChildren()
public bool RecursiveArrayIterator::hasChildren()
/* Inherited methods */
public __construct(arrayobject $array = [], int $flags = 0)
public void append(mixed $value)
public true asort(int $flags = SORT_REGULAR)
public int count()
public mixed current()
public array getArrayCopy()
public int getFlags()
public stringintnull key()
public true ksort(int $flags = SORT_REGULAR)
public true natcasesort()
public true natsort()
public void next()
public bool offsetExists(mixed $key)
public mixed offsetGet(mixed $key)
public void offsetSet(mixed $key, mixed $value)
public void offsetUnset(mixed $key)
public void rewind()
public void seek(int $offset)
public string serialize()
public void setFlags(int $flags)
public true uasort(callable $callback)
public true uksort(callable $callback)
public void unserialize(string $data)
public bool valid()

Predefined Constants

RecursiveArrayIterator Flags

RecursiveArrayIterator::CHILD_ARRAYS_ONLY

Treat only arrays (not objects) as having children for recursive iteration.

Table of Contents