xref: /PHP-8.4/ext/spl/tests/iterator_012.phpt (revision f8d79582)
1--TEST--
2SPL: NoRewindIterator
3--FILE--
4<?php
5
6echo "===Current===\n";
7
8$it = new NoRewindIterator(new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C')));
9
10echo $it->key() . '=>' . $it->current() . "\n";
11
12echo "===Next===\n";
13
14$it->next();
15
16echo "===Foreach===\n";
17
18foreach($it as $key=>$val)
19{
20    echo "$key=>$val\n";
21}
22
23?>
24--EXPECT--
25===Current===
260=>A
27===Next===
28===Foreach===
291=>B
302=>C
31