php-src/ext/spl/examples/tests/iterators_003.phpt

36 lines
461 B
Plaintext
Raw Normal View History

2004-04-28 21:52:51 +00:00
--TEST--
SPL: NoRweindIterator
--FILE--
<?php
require_once('examples.inc');
echo "===Current===\n";
$it = new NoRewindIterator(new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C')));
echo $it->key() . '=>' . $it->current() . "\n";
echo "===Next===\n";
$it->next();
echo "===Foreach===\n";
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
===Current===
0=>A
===Next===
===Foreach===
1=>B
2=>C
===DONE===