<?php $ai = new ArrayIterator(array(new stdClass(), new stdClass())); $ci = new CachingIterator($ai); var_dump($ci->__toString());