大网数据广告活动
PHP 语言与运行手册

The RecursiveIteratorIterator class

· 52CE 我爱测

Can be used to iterate through recursive iterators.

The RecursiveIteratorIterator class

(PHP 5, PHP 7, PHP 8)

简介

Can be used to iterate through recursive iterators.

Calls to methods that RecursiveIteratorIterator does not have are forwarded to the iterator at the current depth, as returned by RecursiveIteratorIterator::getSubIterator(). This does not use __call().

类摘要

class RecursiveIteratorIterator implements OuterIterator {
/* 常量 */
public const int LEAVES_ONLY;
public const int SELF_FIRST;
public const int CHILD_FIRST;
public const int CATCH_GET_CHILD;
/* 方法 */
public function __construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0)
public function beginChildren(): void
public function beginIteration(): void
public function callHasChildren(): bool
public function current(): mixed
public function endChildren(): void
public function endIteration(): void
public function getDepth(): int
public function getMaxDepth(): int|false
public function getSubIterator(?int $level = null): ?RecursiveIterator
public function key(): mixed
public function next(): void
public function nextElement(): void
public function rewind(): void
public function setMaxDepth(int $maxDepth = -1): void
public function valid(): bool
}

更新日志

版本 说明
8.4.0 类常量现在是有类型的。

目录

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。