ArrayIterator::__construct
(PHP 5, PHP 7, PHP 8)
ArrayIterator::__construct — Construct an ArrayIterator
参数
array
The array or object to be iterated on. Passing an object is deprecated as of PHP 8.5.0.
flags
Flags to control the behaviour of the ArrayIterator object. See ArrayIterator::setFlags().
错误/异常
As of PHP 8.5.0, throws an
InvalidArgumentException if
array is an enum.
更新日志
| 版本 | 说明 |
|---|---|
| 8.5.0 |
Passing an enum as array now throws an
InvalidArgumentException.
|
| 8.5.0 |
Passing an object as array is deprecated.
|
参见
- ArrayIterator::getArrayCopy() - Get array copy
- ArrayIterator::setFlags() - Set behaviour flags
- ArrayObject::__construct() - Construct a new array object
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
