The CachingIterator class
(PHP 5, PHP 7, PHP 8)
Introduction
This object supports cached iteration over another iterator.
Class synopsis
/* Constants */
/* Methods */
/* Inherited methods */
}Predefined Constants
CachingIterator::CALL_TOSTRINGConvert every element to string.
CachingIterator::CATCH_GET_CHILDDon't throw exception in accessing children.
CachingIterator::TOSTRING_USE_KEYUse key for conversion to string.
CachingIterator::TOSTRING_USE_CURRENTUse current for conversion to string.
CachingIterator::TOSTRING_USE_INNERUse inner for conversion to string.
CachingIterator::FULL_CACHECache all read data.
Changelog
| Version | Description |
|---|---|
| 8.0.0 | CachingIterator implements Stringable now. |
Table of Contents
- CachingIterator::__construct — Construct a new CachingIterator object for the iterator
- CachingIterator::count — The number of elements in the iterator
- CachingIterator::current — Return the current element
- CachingIterator::getCache — Retrieve the contents of the cache
- CachingIterator::getFlags — Get flags used
- CachingIterator::hasNext — Check whether the inner iterator has a valid next element
- CachingIterator::key — Return the key for the current element
- CachingIterator::next — Move the iterator forward
- CachingIterator::offsetExists — The offsetExists purpose
- CachingIterator::offsetGet — The offsetGet purpose
- CachingIterator::offsetSet — The offsetSet purpose
- CachingIterator::offsetUnset — The offsetUnset purpose
- CachingIterator::rewind — Rewind the iterator
- CachingIterator::setFlags — The setFlags purpose
- CachingIterator::__toString — Return the string representation of the current element
- CachingIterator::valid — Check whether the current element is valid
↑ and ↓ to navigate • Enter to select • Esc to close • / to open