ArrayIterator::__construct

(PHP 5, PHP 7)

ArrayIterator::__constructConstruct an ArrayIterator

说锟斤拷

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

Constructs an ArrayIterator object.

Warning

锟斤拷锟斤拷锟斤拷锟斤拷未锟斤拷写锟侥碉拷锟斤拷锟斤拷锟叫诧拷锟斤拷锟叫憋拷

锟斤拷锟斤拷

array

The array or object to be iterated on.

flags

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

锟斤拷锟斤拷值

An ArrayIterator object.

锟斤拷锟斤拷锟届常

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

锟轿硷拷