php8.5
Home/ Manual/ reference / simplexml/ The SimpleXMLIterator class

The SimpleXMLIterator class

The SimpleXMLIterator provides recursive iteration over all nodes of a SimpleXMLElement object.

Intro

The SimpleXMLIterator provides recursive iteration over all nodes of a SimpleXMLElement object.

Class synopsis

class SimpleXMLIterator extends SimpleXMLElement { }

Changelog

VersionDescription
8.0.0Iterator methods (SimpleXMLIterator::hasChildren, SimpleXMLIterator::getChildren, SimpleXMLIterator::current, SimpleXMLIterator::key, SimpleXMLIterator::next,SimpleXMLIterator::rewind, SimpleXMLIterator::valid) were moved to SimpleXMLElement.
8.0.0SimpleXMLIterator implements Stringable now.

Source: reference/simplexml/simplexmliterator.xml · from the official PHP manual (php/doc-en)