The MultipleIterator class
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
简介
An Iterator that iterates over all attached iterators in parallel. At each step, it yields an array containing the current element of each attached iterator, and moves all of them forward together.
类摘要
$flags = MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC)预定义常量
MultipleIterator::MIT_NEED_ANY
Do not require all sub iterators to be valid in iteration.
MultipleIterator::MIT_NEED_ALL
Require all sub iterators to be valid in iteration.
MultipleIterator::MIT_KEYS_NUMERIC
Keys are created from the sub iterators position.
MultipleIterator::MIT_KEYS_ASSOC
Keys are created from sub iterators associated information.
更新日志
| 版本 | 说明 |
|---|---|
| 8.4.0 | 类常量现在是有类型的。 |
目录
- MultipleIterator::attachIterator — Attaches iterator information
- MultipleIterator::__construct — Constructs a new MultipleIterator
- MultipleIterator::containsIterator — Checks if an iterator is attached
- MultipleIterator::countIterators — Gets the number of attached iterator instances
- MultipleIterator::current — Gets the current elements of the attached iterators
- MultipleIterator::detachIterator — Detaches an iterator
- MultipleIterator::getFlags — Gets the flag information
- MultipleIterator::key — Gets the keys of the attached iterators
- MultipleIterator::next — Moves all attached iterator instances forward
- MultipleIterator::rewind — Rewinds all attached iterator instances
- MultipleIterator::setFlags — Sets flags
- MultipleIterator::valid — Checks the validity of sub iterators
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
