(PHP 5 >= 5.1.0, PHP 7, PHP 8)
LimitIterator::getPosition — Retourne la position courante
Retourne la position (partant de zéro) de l'itérateur interne Iterator.
Cette fonction ne contient aucun paramètre.
La position courante.
Exemple #1 Exemple LimitIterator::getPosition()
<?php
$fruits = array(
    'a' => 'apple',
    'b' => 'banana',
    'c' => 'cherry',
    'd' => 'damson',
    'e' => 'elderberry'
);
$array_it = new ArrayIterator($fruits);
$limit_it = new LimitIterator($array_it, 2, 3);
foreach ($limit_it as $item) {
    echo $limit_it->getPosition() . ' ' . $item . "\n";
}
?>L'exemple ci-dessus va afficher :
2 cherry 3 damson 4 elderberry
