array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'norewinditerator.rewind.php', 1 => 'NoRewindIterator::rewind', 2 => 'Prevents the rewind operation on the inner iterator', ), 'up' => array ( 0 => 'class.norewinditerator.php', 1 => 'NoRewindIterator', ), 'prev' => array ( 0 => 'norewinditerator.next.php', 1 => 'NoRewindIterator::next', ), 'next' => array ( 0 => 'norewinditerator.valid.php', 1 => 'NoRewindIterator::valid', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/norewinditerator/rewind.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

NoRewindIterator::rewind

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

NoRewindIterator::rewindPrevents the rewind operation on the inner iterator

Beschreibung

public NoRewindIterator::rewind(): void

Prevents the rewind operation on the inner iterator.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 NoRewindIterator::rewind() example

This example demonstrates that calling rewind on a NoRewindIterator object has no effect.

<?php
$fruits
= array("lemon", "orange", "apple", "pear");

$noRewindIterator = new NoRewindIterator(new ArrayIterator($fruits));

echo
$noRewindIterator->current() . "\n";
$noRewindIterator->next();
// now rewind the iterator (nothing should happen)
$noRewindIterator->rewind();
echo
$noRewindIterator->current() . "\n";
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

lemon
orange