summaryrefslogtreecommitdiff
path: root/ext/spl/tests/array_iterator.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/array_iterator.phpt')
-rwxr-xr-xext/spl/tests/array_iterator.phpt138
1 files changed, 0 insertions, 138 deletions
diff --git a/ext/spl/tests/array_iterator.phpt b/ext/spl/tests/array_iterator.phpt
deleted file mode 100755
index 57e1976f03..0000000000
--- a/ext/spl/tests/array_iterator.phpt
+++ /dev/null
@@ -1,138 +0,0 @@
---TEST--
-SPL: spl_array_iterator
---SKIPIF--
-<?php if (!extension_loaded("spl")) print "skip"; ?>
---FILE--
-<?php
-
-echo "==Normal==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new spl_array($arr);
-
-foreach($obj as $ak=>$av) {
- foreach($obj as $bk=>$bv) {
- if ($ak==0 && $bk==0) {
- $arr[0] = "modify";
- }
- echo "$ak=>$av - $bk=>$bv\n";
- }
-}
-
-echo "==UseRef==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new spl_array(&$arr);
-
-foreach($obj as $ak=>$av) {
- foreach($obj as $bk=>$bv) {
- echo "$ak=>$av - $bk=>$bv\n";
- }
-}
-
-echo "==Modify==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new spl_array(&$arr);
-
-foreach($obj as $ak=>$av) {
- foreach($obj as $bk=>$bv) {
- if ($ak==0 && $bk==0) {
- $arr[0] = "modify";
- }
- echo "$ak=>$av - $bk=>$bv\n";
- }
-}
-
-echo "==Delete==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new spl_array(&$arr);
-
-foreach($obj as $ak=>$av) {
- foreach($obj as $bk=>$bv) {
- if ($ak==1 && $bk==1) {
- unset($arr[1]);
- }
- echo "$ak=>$av - $bk=>$bv\n";
- }
-}
-
-echo "==Change==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new spl_array(&$arr);
-
-foreach($obj as $ak=>$av) {
- foreach($obj as $bk=>$bv) {
- if ($ak==1 && $bk==1) {
- $arr = NULL;
- }
- echo "$ak=>$av - $bk=>$bv\n";
- }
-}
-
-echo "Done\n";
-?>
---EXPECTF--
-==Normal==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>0
-2=>2 - 1=>1
-2=>2 - 2=>2
-==UseRef==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>0
-2=>2 - 1=>1
-2=>2 - 2=>2
-==Modify==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>modify
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>modify
-2=>2 - 1=>1
-2=>2 - 2=>2
-==Delete==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-
-Notice: next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
-1=>1 - 0=>0
-1=>1 - 2=>2
-
-Notice: next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
-0=>0 - 0=>0
-0=>0 - 2=>2
-2=>2 - 0=>0
-2=>2 - 2=>2
-==Change==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-
-Notice: next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-
-Notice: has_more(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-
-Notice: next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-
-Notice: has_more(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-Done