PHP Doku:: Constructs an InfiniteIterator - infiniteiterator.construct.html

Verlauf / Chronik / History: (3) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)IteratorenThe InfiniteIterator classInfiniteIterator::__construct

Ein Service von Reinhard Neidl - Webprogrammierung.

The InfiniteIterator class

<<The InfiniteIterator class

InfiniteIterator::next>>

InfiniteIterator::__construct

(PHP 5 >= 5.1.0)

InfiniteIterator::__constructConstructs an InfiniteIterator

Beschreibung

InfiniteIterator::__construct ( Iterator $iterator )

Constructs an InfiniteIterator from an Iterator.

Parameter-Liste

iterator

The iterator to infinitely iterate over.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Fehler/Exceptions

Throws an E_RECOVERABLE_ERROR if the iterator parameter is not an Iterator.

Beispiele

Beispiel #1 InfiniteIterator::__construct() example

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

cat
dog
cat
dog
cat
dog
cat

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)