downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

InfiniteIterator::next> <InfiniteIterator
[edit] Last updated: Fri, 25 May 2012

view this page in

InfiniteIterator::__construct

(PHP 5 >= 5.1.0)

InfiniteIterator::__constructConstruit un InfiniteIterator

Description

public InfiniteIterator::__construct ( Iterator $iterator )

Construit un InfiniteIterator pour un Iterator.

Liste de paramètres

iterator

L'itérateur à passer infiniment.

Valeurs de retour

Aucune valeur n'est retournée.

Erreurs / Exceptions

Lance une exception E_RECOVERABLE_ERROR si le paramètre iterator n'est pas un Iterator.

Exemples

Exemple #1 Exemple avec InfiniteIterator::__construct()

<?php
$arrayit  
= new ArrayIterator(array('cat','dog'));
$infinite = new InfiniteIterator($arrayit);
$limit    = new LimitIterator($infinite07);
foreach(
$limit as $value)
{
    echo 
"$value\n";
}
?>

L'exemple ci-dessus va afficher :

cat
dog
cat
dog
cat
dog
cat

Voir aussi



add a note add a note User Contributed Notes InfiniteIterator::__construct
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites