php8.5
Home/ Manual/ reference / spl/ The CachingIterator class

The CachingIterator class

This object supports cached iteration over another iterator.

Intro

This object supports cached iteration over another iterator.

Class synopsis

class CachingIterator extends IteratorIterator implements ArrayAccess implements Countable implements Stringable { }

Predefined Constants

CachingIterator::CALL_TOSTRING

Convert every element to string.

CachingIterator::CATCH_GET_CHILD

Don't throw exception in accessing children.

CachingIterator::TOSTRING_USE_KEY

Use key for conversion to string.

CachingIterator::TOSTRING_USE_CURRENT

Use current for conversion to string.

CachingIterator::TOSTRING_USE_INNER

Use inner for conversion to string.

CachingIterator::FULL_CACHE

Cache all read data.

Changelog

VersionDescription
8.0.0CachingIterator implements Stringable now.

Changelog

VersionDescription

Cachingiterator

In this section

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