<?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_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.
<?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());
?>