The RecursiveIterator interface

- « OuterIterator::getInnerIterator

- RecursiveIterator::getChildren »

- PHP Manual
- Interfaces
- The RecursiveIterator interface

# The RecursiveIterator interface

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

## Introduction

Classes implementing RecursiveIterator can be used to iterate over iterators recursively.

## Interface synopsis

interface RecursiveIterator extends Iterator {
/* Methods */
public getChildren(): ?RecursiveIterator
public hasChildren(): bool
/* Inherited methods */
public Iterator::current(): mixed
public Iterator::key(): mixed
public Iterator::next(): void
public Iterator::rewind(): void
public Iterator::valid(): bool
}

## Table of Contents

- RecursiveIterator::getChildren — Returns an iterator for the current entry
- RecursiveIterator::hasChildren — Returns if an iterator can be created for the current entry