<?php
//This snippet will print out all the cached elements (foreach) .
$cache = new CachingIterator(new ArrayIterator(range(1,100)), CachingIterator::FULL_CACHE);
foreach ($cache as $c) {
}
print_r($cache->getCache());
?>
(PHP 5, PHP 7)
This object supports cached iteration over another iterator.
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.
<?php
//This snippet will print out all the cached elements (foreach) .
$cache = new CachingIterator(new ArrayIterator(range(1,100)), CachingIterator::FULL_CACHE);
foreach ($cache as $c) {
}
print_r($cache->getCache());
?>