(PHP 5, PHP 7)
This iterator allows to unset and modify values and keys while iterating over Arrays and Objects.
When you want to iterate over the same array multiple times you need to instantiate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually.
ArrayIterator implements ArrayAccess , SeekableIterator , Countable , Serializable {
const
int
STD_PROP_LIST
= 1
const
int
ARRAY_AS_PROPS
= 2
/* Methods */
public asort ( ) : void
public __construct
([ mixed $array
= array()
[, int $flags
= 0
]] )
public count ( ) : int
public getArrayCopy ( ) : array
public getFlags ( ) : int
public ksort ( ) : void
public natcasesort ( ) : void
public natsort ( ) : void
public next ( ) : void
public offsetExists
( mixed $index
) : bool
public offsetUnset
( mixed $index
) : void
public rewind ( ) : void
public seek
( int $position
) : void
public serialize ( ) : string
public setFlags
( string $flags
) : void
public unserialize
( string $serialized
) : void
public valid ( ) : bool
}
ArrayIterator::STD_PROP_LIST
ArrayIterator::ARRAY_AS_PROPS
/* Constants */