A classe CachingIterator

Introdução

...

Sinopse da classe

CachingIterator extends IteratorIterator implements OuterIterator , Traversable , Iterator , ArrayAccess , Countable {
/* Métodos */
public __construct ( Iterator $iterator [, int $flags = self::CALL_TOSTRING ] )
public count ( void ) : int
public current ( void ) : mixed
public getCache ( void ) : array
public getFlags ( void ) : int
public getInnerIterator ( void ) : Iterator
hasNext ( void ) : bool
public key ( void ) : scalar
next ( void ) : void
public offsetExists ( mixed $index ) : void
public offsetGet ( string $index ) : void
public offsetSet ( mixed $index , mixed $newval ) : void
public offsetUnset ( string $index ) : void
rewind ( void ) : void
public setFlags ( int $flags ) : void
__toString ( void ) : string
valid ( void ) : bool
}

Índice

add a note add a note

User Contributed Notes 1 note

up
4
ahmad dot mayahi at gmail dot com
3 years ago
<?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());
?>
To Top