The caching part of the CachingIterator

Code
<?php

$i 
= new ArrayIterator(array(1,7,9));

$ci = new CachingIterator($iCachingIterator::FULL_CACHE);

foreach(
$ci as $value) {
    echo 
$value PHP_EOL;
    
var_dump($ci->getCache());
}
Result
1
array(1) {
[0]=>
int(1)
}
7
array(2) {
[0]=>
int(1)
[1]=>
int(7)
}
9
array(3) {
[0]=>
int(1)
[1]=>
int(7)
[2]=>
int(9)
}
Used Versions
PHP 7.2, Zend 3.0, Symfony 4.0, Laravel 5.6, PHPUnit 6.5, Doctrine 2.8