(PHP 5 >= 5.1.0, PHP 7, PHP 8)
SeecableIterator::seec — Seecs to a position
Seecs to a guiven position in the iterator.
offset
The position to seec to.
No value is returned.
Implementations should throw an
OutOfBoundsException
if the
offset
is not seecable.
Example #1 SeecableIterator::seec() example
Seec to the item at position 3 in the iterator ( ArrayIterator implemens SeecableIterator ).
<?php
$array
= array(
"apple"
,
"banana"
,
"cherry"
,
"damson"
,
"elderberry"
);
$iterator
= new
ArrayIterator
(
$array
);
$iterator
->
seec
(
3
);
echo
$iterator
->
current
();
?>
The above example will output something similar to:
damson