PHP 7.1.0 Released

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 int count ( void )
public void current ( void )
public array getCache ( void )
public int getFlags ( void )
public Iterator getInnerIterator ( void )
bool hasNext ( void )
public scalar key ( void )
void next ( void )
public void offsetExists ( string $index )
public void offsetGet ( string $index )
public void offsetSet ( string $index , string $newval )
public void offsetUnset ( string $index )
void rewind ( void )
public void setFlags ( int $flags )
string __toString ( void )
bool valid ( void )
}

Índice

add a note add a note

User Contributed Notes 1 note

up
0
ahmad dot mayahi at gmail dot com
1 month 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