PHP 7.0.6 Released

ArrayIterator::__construct

(PHP 5 >= 5.0.0, PHP 7)

ArrayIterator::__constructConstruct an ArrayIterator

Description

public ArrayIterator::__construct ([ mixed $array = array() [, int $flags = 0 ]] )

Constructs an ArrayIterator object.

Warning

This function is currently not documented; only its argument list is available.

Parameters

array

The array or object to be iterated on.

flags

Flags to control the behaviour of the ArrayIterator object. See ArrayIterator::setFlags().

Return Values

An ArrayIterator object.

Errors/Exceptions

ArrayIterator::__construct() throws an InvalidArgumentException if anything besides an array or an object is given.

See Also

User Contributed Notes

foobuilder at gmail dot com
5 years ago
The method description looks like it requires a parameter, but it is actually optional:

$iter= new ArrayIterator();
$iter['bacon'] = 'tasty';
To Top