summaryrefslogtreecommitdiff
path: root/ext/spl/tests/iterator_012.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/iterator_012.phpt')
-rw-r--r--ext/spl/tests/iterator_012.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/spl/tests/iterator_012.phpt b/ext/spl/tests/iterator_012.phpt
new file mode 100644
index 0000000..81bc02f
--- /dev/null
+++ b/ext/spl/tests/iterator_012.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SPL: NoRewindIterator
+--FILE--
+<?php
+
+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===