Search Results
The only difference between CachingIterator and other Iterators such as ArrayIterator is the hasNext() method. Since the data will be loaded into the memory, the CachingIterator is able to check whether the given iterator has a next element.
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.
When this flag (or the CachingIterator::TOSTRING_USE_INNER flag) is set, and the CachingIterator::next() method is called (i.e. during iteration) the current value (in this case each sub-array) or the inner iterator (in this case, the ArrayIterator), respectively, is converted to a string and saved internally.
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 ...
The CachingIterator class Introduction (PHP 5, PHP 7) This object supports cached iteration over another iterator. Class synopsis CachingIterator extends IteratorIterator implements OuterIterator , ArrayAccess , Countable { /* Constants */ const int CALL_TOSTRING = 1 ; const int CATCH_GET_CHILD = 16 ; const int TOSTRING_USE_KEY = 2 ; const int TOSTRING_USE_CURRENT = 4 ; const int TOSTRING_USE ...
The CachingIterator class Introduction (PHP 5, PHP 7, PHP 8) This object supports cached iteration over another iterator.
People also ask
How do I set a cachingiterator flag in PHP?
Does cachingiterator implement stringable now?
What does 'cached iteration over another iterator' mean?
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::getInnerIterator — Returns the inner ...
