PHP 7.4.22 Released!

InfiniteIterator::__construct

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

InfiniteIterator::__constructConstructs an InfiniteIterator

Açıklama

public InfiniteIterator::__construct(Iterator $iterator)

Constructs an InfiniteIterator from an Iterator.

Değiştirgeler

iterator

The iterator to infinitely iterate over.

Dönen Değerler

Hiçbir değer dönmez.

Hatalar/İstisnalar

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

Örnekler

Örnek 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";
}
?>

Yukarıdaki örneğin çıktısı:

cat
dog
cat
dog
cat
dog
cat

Ayrıca Bakınız

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top