From 88ec761548b66f58acc1a86cdd0fc164ca925476 Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Sun, 15 Oct 2006 21:09:28 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'. --- ext/spl/tests/.htaccess | 3 - ext/spl/tests/array_001.phpt | 103 ------ ext/spl/tests/array_002.phpt | 37 -- ext/spl/tests/array_003.phpt | 61 ---- ext/spl/tests/array_004.phpt | 143 -------- ext/spl/tests/array_005.phpt | 93 ------ ext/spl/tests/array_006.phpt | 32 -- ext/spl/tests/array_007.phpt | 65 ---- ext/spl/tests/array_008.phpt | 62 ---- ext/spl/tests/array_009.phpt | 26 -- ext/spl/tests/array_009a.phpt | 39 --- ext/spl/tests/array_010.phpt | 146 -------- ext/spl/tests/array_011.phpt | 37 -- ext/spl/tests/array_012.phpt | 65 ---- ext/spl/tests/array_013.phpt | 81 ----- ext/spl/tests/array_014.phpt | 61 ---- ext/spl/tests/array_015.phpt | 87 ----- ext/spl/tests/array_016.phpt | 34 -- ext/spl/tests/array_017.phpt | 649 ------------------------------------ ext/spl/tests/array_018.phpt | 42 --- ext/spl/tests/array_019.phpt | 32 -- ext/spl/tests/array_020.phpt | 66 ---- ext/spl/tests/array_021.phpt | 33 -- ext/spl/tests/array_022.phpt | 72 ---- ext/spl/tests/bug28822.phpt | 18 - ext/spl/tests/bug31185.phpt | 63 ---- ext/spl/tests/bug31346.phpt | 21 -- ext/spl/tests/bug31348.phpt | 17 - ext/spl/tests/bug31926.phpt | 18 - ext/spl/tests/bug32134.phpt | 50 --- ext/spl/tests/bug32394.phpt | 19 -- ext/spl/tests/bug33136.phpt | 74 ---- ext/spl/tests/bug34548.phpt | 40 --- ext/spl/tests/bug36258.phpt | 21 -- ext/spl/tests/bug36287.phpt | 40 --- ext/spl/tests/bug36825.phpt | 33 -- ext/spl/tests/bug36941.phpt | 48 --- ext/spl/tests/bug37457.phpt | 82 ----- ext/spl/tests/dit_001.phpt | 19 -- ext/spl/tests/fileobject_001.phpt | 90 ----- ext/spl/tests/fileobject_001a.txt | 6 - ext/spl/tests/fileobject_001b.txt | 6 - ext/spl/tests/fileobject_002.phpt | 124 ------- ext/spl/tests/fileobject_003.phpt | 89 ----- ext/spl/tests/iterator_001.phpt | 173 ---------- ext/spl/tests/iterator_002.phpt | 57 ---- ext/spl/tests/iterator_003.phpt | 97 ------ ext/spl/tests/iterator_004.phpt | 144 -------- ext/spl/tests/iterator_005.phpt | 54 --- ext/spl/tests/iterator_006.phpt | 24 -- ext/spl/tests/iterator_007.phpt | 168 ---------- ext/spl/tests/iterator_008.phpt | 91 ----- ext/spl/tests/iterator_009.phpt | 47 --- ext/spl/tests/iterator_010.phpt | 20 -- ext/spl/tests/iterator_011.phpt | 53 --- ext/spl/tests/iterator_012.phpt | 35 -- ext/spl/tests/iterator_013.phpt | 68 ---- ext/spl/tests/iterator_014.phpt | 140 -------- ext/spl/tests/iterator_015.phpt | 64 ---- ext/spl/tests/iterator_016.phpt | 78 ----- ext/spl/tests/iterator_017.phpt | 20 -- ext/spl/tests/iterator_018.phpt | 53 --- ext/spl/tests/iterator_019.phpt | 35 -- ext/spl/tests/iterator_020.phpt | 68 ---- ext/spl/tests/iterator_021.phpt | 182 ---------- ext/spl/tests/iterator_022.phpt | 188 ----------- ext/spl/tests/iterator_023.phpt | 195 ----------- ext/spl/tests/iterator_024.phpt | 51 --- ext/spl/tests/iterator_025.phpt | 94 ------ ext/spl/tests/iterator_026.phpt | 36 -- ext/spl/tests/iterator_027.phpt | 85 ----- ext/spl/tests/iterator_028.phpt | 114 ------- ext/spl/tests/iterator_029.phpt | 40 --- ext/spl/tests/iterator_030.phpt | 46 --- ext/spl/tests/iterator_031.phpt | 118 ------- ext/spl/tests/iterator_032.phpt | 52 --- ext/spl/tests/iterator_033.phpt | 46 --- ext/spl/tests/iterator_034.phpt | 190 ----------- ext/spl/tests/iterator_035.phpt | 17 - ext/spl/tests/iterator_036.phpt | 24 -- ext/spl/tests/iterator_037.phpt | 133 -------- ext/spl/tests/iterator_038.phpt | 21 -- ext/spl/tests/iterator_039.phpt | 123 ------- ext/spl/tests/iterator_040.phpt | 49 --- ext/spl/tests/iterator_041.phpt | 119 ------- ext/spl/tests/iterator_041a.phpt | 109 ------ ext/spl/tests/iterator_041b.phpt | 107 ------ ext/spl/tests/iterator_042.phpt | 104 ------ ext/spl/tests/iterator_043.phpt | 20 -- ext/spl/tests/iterator_044.phpt | 169 ---------- ext/spl/tests/iterator_045.phpt | 171 ---------- ext/spl/tests/iterator_046.phpt | 53 --- ext/spl/tests/iterator_047.phpt | 119 ------- ext/spl/tests/iterator_048.phpt | 38 --- ext/spl/tests/iterator_049.phpt | 24 -- ext/spl/tests/iterator_049b.phpt | Bin 616 -> 0 bytes ext/spl/tests/iterator_050.phpt | 93 ------ ext/spl/tests/iterator_051.phpt | 95 ------ ext/spl/tests/iterator_052.phpt | 314 ----------------- ext/spl/tests/iterator_053.phpt | 314 ----------------- ext/spl/tests/iterator_054.phpt | 84 ----- ext/spl/tests/iterator_055.phpt | 61 ---- ext/spl/tests/observer_001.phpt | 118 ------- ext/spl/tests/observer_002.phpt | 201 ----------- ext/spl/tests/spl_001.phpt | 36 -- ext/spl/tests/spl_002.phpt | 24 -- ext/spl/tests/spl_003.phpt | 76 ----- ext/spl/tests/spl_004.phpt | 86 ----- ext/spl/tests/spl_005.phpt | 23 -- ext/spl/tests/spl_autoload_001.phpt | 138 -------- ext/spl/tests/spl_autoload_002.phpt | 71 ---- ext/spl/tests/spl_autoload_003.phpt | 46 --- ext/spl/tests/spl_autoload_004.phpt | 45 --- ext/spl/tests/spl_autoload_005.phpt | 57 ---- ext/spl/tests/spl_autoload_006.phpt | 39 --- ext/spl/tests/spl_autoload_007.phpt | 140 -------- ext/spl/tests/spl_autoload_008.phpt | 131 -------- ext/spl/tests/sxe_001.phpt | 64 ---- ext/spl/tests/sxe_002.phpt | 77 ----- ext/spl/tests/sxe_003.phpt | 79 ----- ext/spl/tests/sxe_004.phpt | 147 -------- ext/spl/tests/sxe_005.phpt | 46 --- ext/spl/tests/testclass | 5 - ext/spl/tests/testclass.class.inc | 9 - ext/spl/tests/testclass.inc | 5 - ext/spl/tests/testclass.php.inc | 5 - 126 files changed, 9902 deletions(-) delete mode 100755 ext/spl/tests/.htaccess delete mode 100755 ext/spl/tests/array_001.phpt delete mode 100755 ext/spl/tests/array_002.phpt delete mode 100755 ext/spl/tests/array_003.phpt delete mode 100755 ext/spl/tests/array_004.phpt delete mode 100755 ext/spl/tests/array_005.phpt delete mode 100755 ext/spl/tests/array_006.phpt delete mode 100755 ext/spl/tests/array_007.phpt delete mode 100755 ext/spl/tests/array_008.phpt delete mode 100755 ext/spl/tests/array_009.phpt delete mode 100755 ext/spl/tests/array_009a.phpt delete mode 100755 ext/spl/tests/array_010.phpt delete mode 100755 ext/spl/tests/array_011.phpt delete mode 100755 ext/spl/tests/array_012.phpt delete mode 100755 ext/spl/tests/array_013.phpt delete mode 100755 ext/spl/tests/array_014.phpt delete mode 100755 ext/spl/tests/array_015.phpt delete mode 100755 ext/spl/tests/array_016.phpt delete mode 100755 ext/spl/tests/array_017.phpt delete mode 100755 ext/spl/tests/array_018.phpt delete mode 100755 ext/spl/tests/array_019.phpt delete mode 100755 ext/spl/tests/array_020.phpt delete mode 100755 ext/spl/tests/array_021.phpt delete mode 100755 ext/spl/tests/array_022.phpt delete mode 100755 ext/spl/tests/bug28822.phpt delete mode 100755 ext/spl/tests/bug31185.phpt delete mode 100755 ext/spl/tests/bug31346.phpt delete mode 100755 ext/spl/tests/bug31348.phpt delete mode 100755 ext/spl/tests/bug31926.phpt delete mode 100755 ext/spl/tests/bug32134.phpt delete mode 100755 ext/spl/tests/bug32394.phpt delete mode 100755 ext/spl/tests/bug33136.phpt delete mode 100644 ext/spl/tests/bug34548.phpt delete mode 100644 ext/spl/tests/bug36258.phpt delete mode 100755 ext/spl/tests/bug36287.phpt delete mode 100644 ext/spl/tests/bug36825.phpt delete mode 100755 ext/spl/tests/bug36941.phpt delete mode 100755 ext/spl/tests/bug37457.phpt delete mode 100755 ext/spl/tests/dit_001.phpt delete mode 100755 ext/spl/tests/fileobject_001.phpt delete mode 100755 ext/spl/tests/fileobject_001a.txt delete mode 100755 ext/spl/tests/fileobject_001b.txt delete mode 100755 ext/spl/tests/fileobject_002.phpt delete mode 100755 ext/spl/tests/fileobject_003.phpt delete mode 100755 ext/spl/tests/iterator_001.phpt delete mode 100755 ext/spl/tests/iterator_002.phpt delete mode 100755 ext/spl/tests/iterator_003.phpt delete mode 100755 ext/spl/tests/iterator_004.phpt delete mode 100755 ext/spl/tests/iterator_005.phpt delete mode 100755 ext/spl/tests/iterator_006.phpt delete mode 100755 ext/spl/tests/iterator_007.phpt delete mode 100755 ext/spl/tests/iterator_008.phpt delete mode 100755 ext/spl/tests/iterator_009.phpt delete mode 100755 ext/spl/tests/iterator_010.phpt delete mode 100755 ext/spl/tests/iterator_011.phpt delete mode 100755 ext/spl/tests/iterator_012.phpt delete mode 100755 ext/spl/tests/iterator_013.phpt delete mode 100755 ext/spl/tests/iterator_014.phpt delete mode 100755 ext/spl/tests/iterator_015.phpt delete mode 100755 ext/spl/tests/iterator_016.phpt delete mode 100755 ext/spl/tests/iterator_017.phpt delete mode 100755 ext/spl/tests/iterator_018.phpt delete mode 100755 ext/spl/tests/iterator_019.phpt delete mode 100755 ext/spl/tests/iterator_020.phpt delete mode 100755 ext/spl/tests/iterator_021.phpt delete mode 100755 ext/spl/tests/iterator_022.phpt delete mode 100755 ext/spl/tests/iterator_023.phpt delete mode 100755 ext/spl/tests/iterator_024.phpt delete mode 100755 ext/spl/tests/iterator_025.phpt delete mode 100755 ext/spl/tests/iterator_026.phpt delete mode 100755 ext/spl/tests/iterator_027.phpt delete mode 100755 ext/spl/tests/iterator_028.phpt delete mode 100755 ext/spl/tests/iterator_029.phpt delete mode 100755 ext/spl/tests/iterator_030.phpt delete mode 100755 ext/spl/tests/iterator_031.phpt delete mode 100755 ext/spl/tests/iterator_032.phpt delete mode 100755 ext/spl/tests/iterator_033.phpt delete mode 100755 ext/spl/tests/iterator_034.phpt delete mode 100644 ext/spl/tests/iterator_035.phpt delete mode 100755 ext/spl/tests/iterator_036.phpt delete mode 100755 ext/spl/tests/iterator_037.phpt delete mode 100755 ext/spl/tests/iterator_038.phpt delete mode 100755 ext/spl/tests/iterator_039.phpt delete mode 100755 ext/spl/tests/iterator_040.phpt delete mode 100755 ext/spl/tests/iterator_041.phpt delete mode 100755 ext/spl/tests/iterator_041a.phpt delete mode 100755 ext/spl/tests/iterator_041b.phpt delete mode 100755 ext/spl/tests/iterator_042.phpt delete mode 100755 ext/spl/tests/iterator_043.phpt delete mode 100755 ext/spl/tests/iterator_044.phpt delete mode 100755 ext/spl/tests/iterator_045.phpt delete mode 100755 ext/spl/tests/iterator_046.phpt delete mode 100755 ext/spl/tests/iterator_047.phpt delete mode 100755 ext/spl/tests/iterator_048.phpt delete mode 100755 ext/spl/tests/iterator_049.phpt delete mode 100755 ext/spl/tests/iterator_049b.phpt delete mode 100755 ext/spl/tests/iterator_050.phpt delete mode 100755 ext/spl/tests/iterator_051.phpt delete mode 100755 ext/spl/tests/iterator_052.phpt delete mode 100755 ext/spl/tests/iterator_053.phpt delete mode 100755 ext/spl/tests/iterator_054.phpt delete mode 100755 ext/spl/tests/iterator_055.phpt delete mode 100755 ext/spl/tests/observer_001.phpt delete mode 100755 ext/spl/tests/observer_002.phpt delete mode 100755 ext/spl/tests/spl_001.phpt delete mode 100755 ext/spl/tests/spl_002.phpt delete mode 100755 ext/spl/tests/spl_003.phpt delete mode 100755 ext/spl/tests/spl_004.phpt delete mode 100755 ext/spl/tests/spl_005.phpt delete mode 100755 ext/spl/tests/spl_autoload_001.phpt delete mode 100755 ext/spl/tests/spl_autoload_002.phpt delete mode 100755 ext/spl/tests/spl_autoload_003.phpt delete mode 100755 ext/spl/tests/spl_autoload_004.phpt delete mode 100755 ext/spl/tests/spl_autoload_005.phpt delete mode 100755 ext/spl/tests/spl_autoload_006.phpt delete mode 100755 ext/spl/tests/spl_autoload_007.phpt delete mode 100755 ext/spl/tests/spl_autoload_008.phpt delete mode 100755 ext/spl/tests/sxe_001.phpt delete mode 100755 ext/spl/tests/sxe_002.phpt delete mode 100755 ext/spl/tests/sxe_003.phpt delete mode 100755 ext/spl/tests/sxe_004.phpt delete mode 100755 ext/spl/tests/sxe_005.phpt delete mode 100755 ext/spl/tests/testclass delete mode 100755 ext/spl/tests/testclass.class.inc delete mode 100755 ext/spl/tests/testclass.inc delete mode 100755 ext/spl/tests/testclass.php.inc (limited to 'ext/spl/tests') diff --git a/ext/spl/tests/.htaccess b/ext/spl/tests/.htaccess deleted file mode 100755 index 5a01a1c16e..0000000000 --- a/ext/spl/tests/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - - IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t *.php - diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt deleted file mode 100755 index 1c7566ecb9..0000000000 --- a/ext/spl/tests/array_001.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -SPL: ArrayObject ---SKIPIF-- - ---FILE-- -0, 1=>1); -$ar = new ArrayObject($ar); - -var_dump($ar); - -$ar[2] = 2; -var_dump($ar[2]); -var_dump($ar["3"] = 3); - -var_dump(array_merge((array)$ar, array(4=>4, 5=>5))); - -var_dump($ar["a"] = "a"); - -var_dump($ar); -var_dump($ar[0]); -var_dump($ar[6]); -var_dump($ar["b"]); - -unset($ar[1]); -unset($ar["3"]); -unset($ar["a"]); -unset($ar[7]); -unset($ar["c"]); -var_dump($ar); - -$ar[] = '3'; -$ar[] = 4; -var_dump($ar); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [1]=> - int(1) -} -int(2) -int(3) -array(6) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [4]=> - int(4) - [5]=> - int(5) -} -string(1) "a" -object(ArrayObject)#1 (5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - ["a"]=> - string(1) "a" -} -int(0) - -Notice: Undefined offset: 6 in %sarray_001.php on line %d -NULL - -Notice: Undefined index: b in %sarray_001.php on line %d -NULL - -Notice: Undefined offset: 7 in %sarray_001.php on line %d - -Notice: Undefined index: c in %sarray_001.php on line %d -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [2]=> - int(2) -} -object(ArrayObject)#1 (4) { - [0]=> - int(0) - [2]=> - int(2) - [4]=> - string(1) "3" - [5]=> - int(4) -} -===DONE=== diff --git a/ext/spl/tests/array_002.phpt b/ext/spl/tests/array_002.phpt deleted file mode 100755 index 960253f335..0000000000 --- a/ext/spl/tests/array_002.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SPL: ArrayObject copy constructor ---SKIPIF-- - ---FILE-- - 'one', - '2' => 'two', - '3' => 'three'); - -$object = new ArrayObject($array); -$object[] = 'four'; - -$arrayObject = new ArrayObject($object); - -$arrayObject[] = 'five'; - -var_dump($arrayObject); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#%d (5) { - [1]=> - string(3) "one" - [2]=> - string(3) "two" - [3]=> - string(5) "three" - [4]=> - string(4) "four" - [5]=> - string(4) "five" -} -===DONE=== diff --git a/ext/spl/tests/array_003.phpt b/ext/spl/tests/array_003.phpt deleted file mode 100755 index 386c7bcf7d..0000000000 --- a/ext/spl/tests/array_003.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -SPL: ArrayObject from object ---SKIPIF-- - ---FILE-- -imp = "implicit"; - } -}; - -$test = new test; -$test->dyn = "dynamic"; - -print_r($test); - -$object = new ArrayObject($test); - -print_r($object); - -foreach($test as $key => $val) -{ - echo "$key => $val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -test Object -( - [pub] => public - [pro:protected] => protected - [pri:private] => private - [imp] => implicit - [dyn] => dynamic -) -ArrayObject Object -( - [pub] => public - [pro:protected] => protected - [pri:private] => private - [imp] => implicit - [dyn] => dynamic -) -pub => public -imp => implicit -dyn => dynamic -===DONE=== diff --git a/ext/spl/tests/array_004.phpt b/ext/spl/tests/array_004.phpt deleted file mode 100755 index e7abf2b1dc..0000000000 --- a/ext/spl/tests/array_004.phpt +++ /dev/null @@ -1,143 +0,0 @@ ---TEST-- -SPL: ArrayIterator ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayObject($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 ArrayObject(&$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 "==Modify==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$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 ArrayObject(&$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 ArrayObject(&$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=>modify -1=>1 - 1=>1 -1=>1 - 2=>2 -2=>2 - 0=>modify -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: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.php on line %d -1=>1 - 0=>0 -1=>1 - 2=>2 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.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: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d - -Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d -Done diff --git a/ext/spl/tests/array_005.phpt b/ext/spl/tests/array_005.phpt deleted file mode 100755 index 9214a4c92b..0000000000 --- a/ext/spl/tests/array_005.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -SPL: ArrayObject/Iterator interaction ---SKIPIF-- - ---FILE-- -id = $id; - $this->name = $name; - } - - public function __toString() - { - return $this->id . ', ' . $this->name; - } - - public function getId() - { - return $this->id; - } -} - -class StudentIdFilter extends FilterIterator -{ - private $id; - - public function __construct(ArrayObject $students, Student $other) - { - FilterIterator::__construct($students->getIterator()); - $this->id = $other->getId(); - } - - public function accept() - { - echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; - return $this->current()->getId() == $this->id; - } -} - -class StudentList implements IteratorAggregate -{ - private $students; - - public function __construct() - { - $this->students = new ArrayObject(array()); - } - - public function add(Student $student) - { - if (!$this->contains($student)) { - $this->students[] = $student; - } - } - - public function contains(Student $student) - { - foreach ($this->students as $s) - { - if ($s->getId() == $student->getId()) { - return true; - } - } - return false; - } - - public function getIterator() { - return $this->students->getIterator(); - } -} - -$students = new StudentList(); -$students->add(new Student('01234123', 'Joe')); -$students->add(new Student('00000014', 'Bob')); -$students->add(new Student('00000014', 'Foo')); - -foreach ($students as $student) { - echo $student, "\n"; -} -?> -===DONE=== - ---EXPECT-- -01234123, Joe -00000014, Bob -===DONE=== diff --git a/ext/spl/tests/array_006.phpt b/ext/spl/tests/array_006.phpt deleted file mode 100755 index 5dd9bdec7a..0000000000 --- a/ext/spl/tests/array_006.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SPL: ArrayIterator without ArrayObject ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayIterator($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"; - } -} - -?> -===DONE=== - ---EXPECTF-- -==Normal== -0=>0 - 0=>0 -0=>0 - 1=>1 -0=>0 - 2=>2 -===DONE=== diff --git a/ext/spl/tests/array_007.phpt b/ext/spl/tests/array_007.phpt deleted file mode 100755 index 3e74e00da4..0000000000 --- a/ext/spl/tests/array_007.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -SPL: ArrayObject/Iterator from IteratorAggregate ---SKIPIF-- - ---FILE-- -imp = "implicit"; - } - - function getIterator() - { - $it = new ArrayObject($this); - return $it->getIterator(); - } -}; - -$test = new test; -$test->dyn = "dynamic"; - -print_r($test); - -print_r($test->getIterator()); - -foreach($test as $key => $val) -{ - echo "$key => $val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -test Object -( - [pub] => public - [pro:protected] => protected - [pri:private] => private - [imp] => implicit - [dyn] => dynamic -) -ArrayIterator Object -( - [pub] => public - [pro:protected] => protected - [pri:private] => private - [imp] => implicit - [dyn] => dynamic -) -pub => public -imp => implicit -dyn => dynamic -===DONE=== diff --git a/ext/spl/tests/array_008.phpt b/ext/spl/tests/array_008.phpt deleted file mode 100755 index 613e324776..0000000000 --- a/ext/spl/tests/array_008.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -SPL: ArrayIterator and foreach reference ---SKIPIF-- - ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -0, 1=>1, 2=>2); -$obj = new ArrayObject($arr); - -foreach($obj as $ak=>&$av) { - foreach($obj as $bk=>&$bv) { - if ($ak==0 && $bk==0) { - $bv = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -echo "==UseRef==\n"; - -$arr = array(0=>0, 1=>1, 2=>2); -$obj = new ArrayObject(&$arr); - -foreach($obj as $ak=>&$av) { - foreach($obj as $bk=>&$bv) { - if ($ak==0 && $bk==0) { - $bv = "modify"; - } - echo "$ak=>$av - $bk=>$bv\n"; - } -} - -?> -===DONE=== - ---EXPECTF-- -==Normal== -0=>modify - 0=>modify -0=>modify - 1=>1 -0=>modify - 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 -==UseRef== -0=>modify - 0=>modify -0=>modify - 1=>1 -0=>modify - 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 -===DONE=== diff --git a/ext/spl/tests/array_009.phpt b/ext/spl/tests/array_009.phpt deleted file mode 100755 index 0431cca77e..0000000000 --- a/ext/spl/tests/array_009.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -SPL: ArrayIterator implementing RecursiveIterator ---SKIPIF-- - ---FILE-- - array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/array_009a.phpt b/ext/spl/tests/array_009a.phpt deleted file mode 100755 index aebac08ba6..0000000000 --- a/ext/spl/tests/array_009a.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -SPL: ArrayIterator implementing RecursiveIterator ---SKIPIF-- - ---FILE-- -current()); - } - - function getChildren() - { - return new MyRecursiveArrayIterator($this->current()); - } -} - -$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new MyRecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/array_010.phpt deleted file mode 100755 index dae6b93d6d..0000000000 --- a/ext/spl/tests/array_010.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -SPL: ArrayIterator implements ArrayAccess ---SKIPIF-- - ---FILE-- -'3rd', '4th'=>4)); - -var_dump($obj->getArrayCopy()); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->getArrayCopy()); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->getArrayCopy()); - -?> -===DONE=== - ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -===isset=== -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -===offsetGet=== -string(3) "1st" -int(1) -string(3) "3rd" -int(4) - -Notice: Undefined index: 5th in %sarray_010.php on line %d -NULL - -Notice: Undefined offset: 6 in %sarray_010.php on line %d -NULL -===offsetSet=== -WRITE 1 -string(9) "Changed 1" -WRITE 2 -string(11) "Changed 4th" -WRITE 3 -string(9) "Added 5th" -WRITE 4 -string(7) "Added 6" -string(3) "1st" -string(3) "3rd" -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} - -Notice: Undefined offset: 7 in %sarray_010.php on line %d - -Notice: Undefined index: 8th in %sarray_010.php on line %d -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== diff --git a/ext/spl/tests/array_011.phpt b/ext/spl/tests/array_011.phpt deleted file mode 100755 index 09b132cfef..0000000000 --- a/ext/spl/tests/array_011.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -SPL: ArrayIterator, LimitIterator and string keys ---SKIPIF-- - ---FILE-- - 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5); -//foreach (new ArrayIterator($a) as $k => $v) -foreach (new LimitIterator(new ArrayIterator($a), 1, 3) as $k => $v) -{ - var_dump(array($k, $v)); -} - -?> -===DONE=== - ---EXPECT-- -array(2) { - [0]=> - string(3) "one" - [1]=> - int(1) -} -array(2) { - [0]=> - string(3) "two" - [1]=> - int(2) -} -array(2) { - [0]=> - string(5) "three" - [1]=> - int(3) -} -===DONE=== diff --git a/ext/spl/tests/array_012.phpt b/ext/spl/tests/array_012.phpt deleted file mode 100755 index a8889654a5..0000000000 --- a/ext/spl/tests/array_012.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -SPL: ArrayIterator::count ---SKIPIF-- - ---FILE-- - 0, 'one' => 1, 'two' => 2); -$it = new ArrayIterator($a); - -var_dump($it->count()); -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; - var_dump($it->count()); -} -var_dump($it->count()); - -echo "===Object===\n"; - -class test -{ - public $zero = 0; - protected $pro; - public $one = 1; - private $pri; - public $two = 2; -} - -$o = new test; -$it = new ArrayIterator($o); - -var_dump($it->count()); -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; - var_dump($it->count()); -} -var_dump($it->count()); - -?> -===DONE=== - ---EXPECT-- -===Array=== -int(3) -zero=>0 -int(3) -one=>1 -int(3) -two=>2 -int(3) -int(3) -===Object=== -int(3) -zero=>0 -int(3) -one=>1 -int(3) -two=>2 -int(3) -int(3) -===DONE=== diff --git a/ext/spl/tests/array_013.phpt b/ext/spl/tests/array_013.phpt deleted file mode 100755 index 905b8339c9..0000000000 --- a/ext/spl/tests/array_013.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -SPL: ArrayIterator::append ---SKIPIF-- - ---FILE-- - 'zero', 1 => 'one', 2 => 'two'); -$it = new ArrayIterator($a); - -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append('three'); -$it->append('four'); - -foreach(new NoRewindIterator($it) as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Object===\n"; - -class test -{ - public $zero = 0; - protected $pro; - public $one = 1; - private $pri; - public $two = 2; -} - -$o = new test; -$it = new ArrayIterator($o); - -foreach($it as $key => $val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append('three'); -$it->append('four'); - -foreach(new NoRewindIterator($it) as $key => $val) -{ - echo "$key=>$val\n"; -} - -var_dump($o->{0}); /* doesn't wotk anyway */ - -?> -===DONE=== - ---EXPECTF-- -===Array=== -0=>zero -1=>one -2=>two -===Append=== -3=>three -4=>four -===Object=== -zero=>0 -one=>1 -two=>2 -===Append=== - -Catchable fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in %sarray_013.php on line %d diff --git a/ext/spl/tests/array_014.phpt b/ext/spl/tests/array_014.phpt deleted file mode 100755 index ad9bc6c4ac..0000000000 --- a/ext/spl/tests/array_014.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -SPL: ArrayIterator::seek() ---SKIPIF-- - ---FILE-- -count()); -$it->seek(5); -var_dump($it->current()); -$it->seek(4); -var_dump($it->current()); -try -{ - $it->seek(-1); - var_dump($it->current()); -} -catch(Exception $e) -{ - echo $e->getMessage() . "\n"; -} - -try -{ - $it->seek(12); - var_dump($it->current()); -} -catch(Exception $e) -{ - echo $e->getMessage() . "\n"; -} - -$pos = 0; -foreach($it as $v) -{ - $it->seek($pos++); - var_dump($v); -} - -?> -===DONE=== - ---EXPECTF-- -int(11) -int(5) -int(4) -Seek position -1 is out of range -Seek position 12 is out of range -int(0) -int(1) -int(2) -int(3) -int(4) -int(5) -int(6) -int(7) -int(8) -int(9) -int(10) -===DONE=== diff --git a/ext/spl/tests/array_015.phpt b/ext/spl/tests/array_015.phpt deleted file mode 100755 index 79d6a867f0..0000000000 --- a/ext/spl/tests/array_015.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -SPL: ArrayIterator::next() with internal arrays ---SKIPIF-- - ---FILE-- -getIterator(); - -$ar->offsetUnset($it->key()); -$it->next(); - -var_dump($it->current()); -var_dump($ar); - -foreach($it as $k => $v) -{ - $ar->offsetUnset($k+1); - echo "$k=>$v\n"; -} - -var_dump($ar); - -foreach($it as $k => $v) -{ - $ar->offsetUnset($k); - echo "$k=>$v\n"; -} - -var_dump($ar); - -?> -===DONE=== - ---EXPECTF-- -object(ArrayObject)#%d (5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} - -Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -int(2) -object(ArrayObject)#%d (4) { - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) -} -1=>2 -3=>4 -object(ArrayObject)#%d (2) { - [1]=> - int(2) - [3]=> - int(4) -} -1=>2 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -3=>4 - -Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -object(ArrayObject)#%d (0) { -} -===DONE=== diff --git a/ext/spl/tests/array_016.phpt b/ext/spl/tests/array_016.phpt deleted file mode 100755 index f5a2854200..0000000000 --- a/ext/spl/tests/array_016.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -SPL: ArrayIterator/Object and IteratorIterator ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -int(0) -int(1) -int(2) -int(3) -int(0) -int(1) -int(2) -int(3) -===DONE=== diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/array_017.phpt deleted file mode 100755 index 72bf639986..0000000000 --- a/ext/spl/tests/array_017.phpt +++ /dev/null @@ -1,649 +0,0 @@ ---TEST-- -SPL: ArrayObject::exchangeArray($this) ---SKIPIF-- - ---FILE-- -imp2 = 4; - } - - function dump() - { - echo __METHOD__ . "()\n"; - var_dump(array('Flags'=>$this->getFlags() - ,'OVars'=>get_object_vars($this) - ,'$this'=>$this)); - } - - function setFlags($flags) - { - echo __METHOD__ . "($flags)\n"; - ArrayIterator::setFlags($flags); - } -} - -class ArrayObjectEx extends ArrayObject -{ - public $pub1 = 1; - protected $pro1 = 2; - private $pri1 = 3; - - function __construct($ar = array(), $flags = 0) - { - echo __METHOD__ . "()\n"; - parent::__construct($ar, $flags); - $this->imp1 = 4; - } - - function exchange() - { - echo __METHOD__ . "()\n"; - $this->exchangeArray($this); - } - - function dump() - { - echo __METHOD__ . "()\n"; - var_dump(array('Flags'=>$this->getFlags() - ,'OVars'=>get_object_vars($this) - ,'$this'=>$this)); - } - - function show() - { - echo __METHOD__ . "()\n"; - foreach($this as $n => $v) - { - var_dump(array($n => $v)); - } - } - - function setFlags($flags) - { - echo __METHOD__ . "($flags)\n"; - ArrayObject::setFlags($flags); - } - - function getIterator() - { - echo __METHOD__ . "()\n"; - $it = new ArrayIteratorEx($this, $this->getFlags()); - $it->dyn2 = 5; - $it->dump(); - return $it; - } -} - -function check($obj, $flags) -{ - echo "===CHECK===\n"; - - $obj->setFlags($flags); - $obj->dump(); - $obj->show(); - - echo "===FOREACH===\n"; - - $it = $obj->getIterator(); - foreach($it as $n => $v) - { - var_dump(array($n => $v)); - } - - echo "===PROPERTY===\n"; - - var_dump($obj->pub1); - var_dump(isset($obj->a)); - $obj->setFlags($flags | 2); - var_dump($obj->pub1); - var_dump(isset($obj->a)); - - var_dump($it->pub2); - var_dump(isset($it->pub1)); - $it->setFlags($flags | 2); - var_dump($it->pub2); - var_dump(isset($it->pub1)); -} - -$obj = new ArrayObjectEx(array(0=>1,'a'=>25, 'pub1'=>42), 0); -$obj->dyn1 = 5; - -check($obj, 0); -check($obj, 1); - -echo "#####EXCHANGE#####\n"; - -$obj->exchange(); - -check($obj, 0); -check($obj, 1); - -?> -===DONE=== - ---EXPECTF-- -ArrayObjectEx::__construct() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayObjectEx)#1 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(2) { - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (3) { - [0]=> - int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1:protected"]=> - int(2) - ["pri1:private"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub2"]=> - int(1) - ["pro2:protected"]=> - int(2) - ["pri2:private"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub2"]=> - int(1) - ["pro2:protected"]=> - int(2) - ["pri2:private"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - [0]=> - int(1) -} -array(1) { - ["a"]=> - int(25) -} -array(1) { - ["pub1"]=> - int(42) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(true) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -#####EXCHANGE##### -ArrayObjectEx::exchange() -===CHECK=== -ArrayObjectEx::setFlags(0) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1:protected"]=> - int(2) - ["pri1:private"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(4) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub1"]=> - int(1) - ["pro1:protected"]=> - int(2) - ["pri1:private"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(0) - ["OVars"]=> - array(4) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub1"]=> - int(1) - ["pro1:protected"]=> - int(2) - ["pri1:private"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(2) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(2) -int(1) -bool(true) -===CHECK=== -ArrayObjectEx::setFlags(1) -ArrayObjectEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub1"]=> - int(1) - ["pro1"]=> - int(2) - ["pri1"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } - ["$this"]=> - object(ArrayObjectEx)#1 (5) { - ["pub1"]=> - int(1) - ["pro1:protected"]=> - int(2) - ["pri1:private"]=> - int(3) - ["imp1"]=> - int(4) - ["dyn1"]=> - int(5) - } -} -ArrayObjectEx::show() -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub2"]=> - int(1) - ["pro2:protected"]=> - int(2) - ["pri2:private"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===FOREACH=== -ArrayObjectEx::getIterator() -ArrayIteratorEx::__construct() -ArrayIteratorEx::dump() -array(3) { - ["Flags"]=> - int(1) - ["OVars"]=> - array(5) { - ["pub2"]=> - int(1) - ["pro2"]=> - int(2) - ["pri2"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } - ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub2"]=> - int(1) - ["pro2:protected"]=> - int(2) - ["pri2:private"]=> - int(3) - ["imp2"]=> - int(4) - ["dyn2"]=> - int(5) - } -} -array(1) { - ["pub1"]=> - int(1) -} -array(1) { - ["imp1"]=> - int(4) -} -array(1) { - ["dyn1"]=> - int(5) -} -===PROPERTY=== -int(1) -bool(false) -ArrayObjectEx::setFlags(3) -int(1) -bool(false) -int(1) -bool(false) -ArrayIteratorEx::setFlags(3) -int(1) -bool(true) -===DONE=== diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/array_018.phpt deleted file mode 100755 index ef48b97493..0000000000 --- a/ext/spl/tests/array_018.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -SPL: ArrayObject and \0 ---SKIPIF-- - ---FILE-- -offsetSet("\0", "Foo"); -} -catch (Exception $e) -{ - var_dump($e->getMessage()); -} - -var_dump($foo); - -try -{ - $foo = new ArrayObject(); - $data = explode("=", "=Foo"); - $foo->offsetSet($data[0], $data[1]); -} -catch (Exception $e) -{ - var_dump($e->getMessage()); -} - -var_dump($foo); - -?> -===DONE=== ---EXPECTF-- -string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { -} -===DONE=== diff --git a/ext/spl/tests/array_019.phpt b/ext/spl/tests/array_019.phpt deleted file mode 100755 index 43d53b1273..0000000000 --- a/ext/spl/tests/array_019.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -SPL: ArrayIterator and foreach by reference ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -int(1) -int(2) -int(3) -int(4) - -Fatal error: An iterator cannot be used with foreach by reference in %sarray_019.php on line %d diff --git a/ext/spl/tests/array_020.phpt b/ext/spl/tests/array_020.phpt deleted file mode 100755 index cdeb4a216c..0000000000 --- a/ext/spl/tests/array_020.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -SPL: ArrayIterator overloading ---SKIPIF-- - ---FILE-- - $v) -{ - var_dump($k); - var_dump($v); -} - -?> -===DONE=== - ---EXPECTF-- -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(1) -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -===DONE=== diff --git a/ext/spl/tests/array_021.phpt b/ext/spl/tests/array_021.phpt deleted file mode 100755 index b38cedf0cd..0000000000 --- a/ext/spl/tests/array_021.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -SPL: ArrayObject::seek() and exceptions ---SKIPIF-- - ---FILE-- -seek('bar'); -} -catch (Exception $e) -{ - echo "got exception\n"; -} - -?> -===DONE=== ---EXPECT-- -foo::seek(bar) -got exception -===DONE=== diff --git a/ext/spl/tests/array_022.phpt b/ext/spl/tests/array_022.phpt deleted file mode 100755 index 9cb2193f10..0000000000 --- a/ext/spl/tests/array_022.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -SPL: ArrayObject/Iterator and reference to self ---SKIPIF-- - ---FILE-- -==ArrayObject=== - -==ArrayIterator=== - -===DONE=== ---EXPECTF-- -==ArrayObject=== -object(MyArrayObject)#%d (1) { - ["bar"]=> - string(3) "baz" -} -object(MyArrayObject)#%d (2) { - ["bar"]=> - string(3) "baz" - ["baz"]=> - string(3) "Foo" -} -==ArrayIterator=== -object(MyArrayIterator)#%d (1) { - ["bar"]=> - string(3) "baz" -} -object(MyArrayIterator)#%d (2) { - ["bar"]=> - string(3) "baz" - ["baz"]=> - string(3) "Foo" -} -===DONE=== diff --git a/ext/spl/tests/bug28822.phpt b/ext/spl/tests/bug28822.phpt deleted file mode 100755 index 0cf5575367..0000000000 --- a/ext/spl/tests/bug28822.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #28822 (ArrayObject::offsetExists() works inverted) ---SKIPIF-- - ---FILE-- -offsetSet('key', 'value'); -var_dump($array->offsetExists('key')); -var_dump($array->offsetExists('nokey')); - -?> -===DONE=== ---EXPECT-- -bool(true) -bool(false) -===DONE=== diff --git a/ext/spl/tests/bug31185.phpt b/ext/spl/tests/bug31185.phpt deleted file mode 100755 index 421eb89ec1..0000000000 --- a/ext/spl/tests/bug31185.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #31185 (Crash when exceptions thrown from ArrayAccess::offsetUnset()) ---SKIPIF-- - ---FILE-- -array[$index]); - } - - public function offsetGet($index) { - return $this->array[$index]; - } - - public function offsetSet($index, $value) { - echo __METHOD__ . "($index, $value)\n"; - $this->array[$index] = $value; - } - - public function offsetUnset($index) { - throw new Exception('FAIL'); - unset($this->array[$index]); - } - -} - -$i = 0; $j = 0; -$foo = new FooBar(); -$foo[$j++] = $i++; -$foo[$j++] = $i++; -$foo[$j++] = $i++; -try -{ - unset($foo[1]); -} -catch (Exception $e) -{ - echo "CAUGHT: " . $e->getMessage() . "\n"; -} - -print_R($foo); -?> -===DONE=== ---EXPECT-- -FooBar::offsetSet(0, 0) -FooBar::offsetSet(1, 1) -FooBar::offsetSet(2, 2) -CAUGHT: FAIL -FooBar Object -( - [array:private] => Array - ( - [0] => 0 - [1] => 1 - [2] => 2 - ) - -) -===DONE=== diff --git a/ext/spl/tests/bug31346.phpt b/ext/spl/tests/bug31346.phpt deleted file mode 100755 index ed1b50d685..0000000000 --- a/ext/spl/tests/bug31346.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #31486 (ArrayIterator::next segfaults) ---SKIPIF-- - ---FILE-- -var1=1; - -$ao = new ArrayObject($obj); - -$i = $ao->getIterator(); - -$ao->offsetUnset($i->key()); -$i->next(); - -?> -===DONE=== ---EXPECTF-- -Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sbug31346.php on line %d -===DONE=== diff --git a/ext/spl/tests/bug31348.phpt b/ext/spl/tests/bug31348.phpt deleted file mode 100755 index dcb627af22..0000000000 --- a/ext/spl/tests/bug31348.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #31348 (CachingIterator::rewind() leaks) ---SKIPIF-- - ---FILE-- -rewind(); - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/spl/tests/bug31926.phpt b/ext/spl/tests/bug31926.phpt deleted file mode 100755 index 50246b35ca..0000000000 --- a/ext/spl/tests/bug31926.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #31926 (php in free() error with RecursiveArrayIterator) ---SKIPIF-- - ---FILE-- - array('world')); - -$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array)); -foreach($it as $key => $val) { - var_dump($key, $val); -} - -?> ---EXPECT-- -int(0) -string(5) "world" diff --git a/ext/spl/tests/bug32134.phpt b/ext/spl/tests/bug32134.phpt deleted file mode 100755 index e8527cd15a..0000000000 --- a/ext/spl/tests/bug32134.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug #32134 (Overloading offsetGet/offsetSet) ---SKIPIF-- - ---FILE-- - 3) exit(1); - return parent::offsetGet($index); - } - - public function offsetSet($index, $newval) - { - echo __METHOD__ . "($index,$newval)\n"; - return parent::offsetSet($index, $newval); - } - -} - -$myArray = new myArray(); - -$myArray->offsetSet('one', 'one'); -var_dump($myArray->offsetGet('one')); - -$myArray['two'] = 'two'; -var_dump($myArray['two']); - -?> -===DONE=== - ---EXPECT-- -myArray::offsetSet(one,one) -myArray::offsetGet(one) -string(3) "one" -myArray::offsetSet(two,two) -myArray::offsetGet(two) -string(3) "two" -===DONE=== diff --git a/ext/spl/tests/bug32394.phpt b/ext/spl/tests/bug32394.phpt deleted file mode 100755 index ac72e0fa16..0000000000 --- a/ext/spl/tests/bug32394.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #32394 (offsetUnset() segfaults in a foreach) ---SKIPIF-- - ---FILE-- -append(1); - -foreach($object as $key => $value) -{ - $object->offsetUnset($key); -} - -?> -===DONE=== ---EXPECT-- -===DONE=== diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt deleted file mode 100755 index 13b0583073..0000000000 --- a/ext/spl/tests/bug33136.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #33136 method offsetSet in class extended from ArrayObject crash PHP ---SKIPIF-- - ---FILE-- -data = array(); - parent::__construct($this->data); - } - - function offsetGet($index) - { - echo __METHOD__ . "($index)\n"; - return parent::offsetGet($index); - } - - function offsetSet($index, $value) - { - echo __METHOD__ . "(" . (is_null($index) ? "NULL" : $index) . ",$value)\n"; - parent::offsetSet($index, $value); - } -} - -echo "\n\nInitiate Obj\n"; -$arrayObj = new Collection(); - -echo "Assign values\n"; - -$arrayObj[] = "foo"; -var_dump($arrayObj[0]); - -$arrayObj[] = "bar"; -var_dump($arrayObj[0]); -var_dump($arrayObj[1]); - -$arrayObj["foo"] = "baz"; -var_dump($arrayObj["foo"]); - -print_r($arrayObj); - -var_dump(count($arrayObj)); - -?> -===DONE=== - ---EXPECT-- -Initiate Obj -Assign values -Collection::offsetSet(NULL,foo) -Collection::offsetGet(0) -string(3) "foo" -Collection::offsetSet(NULL,bar) -Collection::offsetGet(0) -string(3) "foo" -Collection::offsetGet(1) -string(3) "bar" -Collection::offsetSet(foo,baz) -Collection::offsetGet(foo) -string(3) "baz" -Collection Object -( - [0] => foo - [1] => bar - [foo] => baz -) -int(3) -===DONE=== diff --git a/ext/spl/tests/bug34548.phpt b/ext/spl/tests/bug34548.phpt deleted file mode 100644 index 73262a8061..0000000000 --- a/ext/spl/tests/bug34548.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #34548 (Method append() in class extended from ArrayObject crashes PHP) ---SKIPIF-- - ---FILE-- -append($value); - } - - public function offsetSet($index, $value) - { - parent::offsetSet($index, $value); - } -} - -$data1=array('one', 'two', 'three'); -$data2=array('four', 'five'); - -$foo=new Collection($data1); -$foo->add($data2); - -print_r($foo->getArrayCopy()); - -echo "Done\n"; -?> ---EXPECT-- -Array -( - [0] => one - [1] => two - [2] => three - [3] => four - [4] => five -) -Done diff --git a/ext/spl/tests/bug36258.phpt b/ext/spl/tests/bug36258.phpt deleted file mode 100644 index 297c7f5978..0000000000 --- a/ext/spl/tests/bug36258.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #36258 (SplFileObject::getPath() may lead to segfault) ---SKIPIF-- - ---FILE-- - $file) { - var_dump($file->getFilename()); - var_dump($file->getPath()); - break; -} - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "%s" -string(%d) "%s" -Done diff --git a/ext/spl/tests/bug36287.phpt b/ext/spl/tests/bug36287.phpt deleted file mode 100755 index 29ae0e2c9d..0000000000 --- a/ext/spl/tests/bug36287.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #36287 ---SKIPIF-- - ---FILE-- -getFilename()); - } - echo "Second\n"; - if($file != "." && $file != "..") - { - var_dump($file->getFilename()); - } - if (++$idx > 1) - { - break; - } -} - -?> -===DONE=== ---EXPECTF-- -First -string(%d) "%s" -Second -string(%d) "%s" -First -string(%d) "%s" -Second -string(%d) "%s" -===DONE=== diff --git a/ext/spl/tests/bug36825.phpt b/ext/spl/tests/bug36825.phpt deleted file mode 100644 index 503ec43a43..0000000000 --- a/ext/spl/tests/bug36825.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -foo::offsetGet(bar) -got exception -===DONE=== diff --git a/ext/spl/tests/bug36941.phpt b/ext/spl/tests/bug36941.phpt deleted file mode 100755 index 2ae03b4481..0000000000 --- a/ext/spl/tests/bug36941.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #36941 (ArrayIterator does not clone itself) ---SKIPIF-- - ---FILE-- -===ArrayObject=== - -===ArrayIterator=== - -===DONE=== ---EXPECT-- -===ArrayObject=== -int(1) -int(1) -int(1) -int(2) -int(1) -int(3) -===ArrayIterator=== -int(1) -int(1) -int(2) -int(2) -int(3) -int(3) -===DONE=== diff --git a/ext/spl/tests/bug37457.phpt b/ext/spl/tests/bug37457.phpt deleted file mode 100755 index 4395287bcd..0000000000 --- a/ext/spl/tests/bug37457.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Bug #37457 (Crash when an exception is thrown in accept() method of FilterIterator) ---SKIPIF-- - ---FILE-- -array = $a; - } - - public function current() - { - echo __METHOD__ . "\n"; - return current($this->array); - } - - public function key() - { - echo __METHOD__ . "\n"; - return key($this->array); - } - - public function next() - { - echo __METHOD__ . "\n"; - $this->valid = (false !== next($this->array)); - } - - public function valid() - { - echo __METHOD__ . "\n"; - return $this->valid; - } - - public function rewind() - { - echo __METHOD__ . "\n"; - $this->valid = (false !== reset($this->array)); - } -} - -class TestFilter extends FilterIterator -{ - public function accept() - { - echo __METHOD__ . "\n"; - throw new Exception("Failure in Accept"); - } -} - -$test = new TestFilter(new Collection(array(0))); - -try -{ - foreach ($test as $item) - { - echo $item; - } -} -catch (Exception $e) -{ - var_dump($e->getMessage()); -} - -?> -===DONE=== ---EXPECTF-- -Collection::__construct -Collection::rewind -Collection::valid -Collection::current -Collection::key -TestFilter::accept -string(17) "Failure in Accept" -===DONE=== diff --git a/ext/spl/tests/dit_001.phpt b/ext/spl/tests/dit_001.phpt deleted file mode 100755 index f02291c77b..0000000000 --- a/ext/spl/tests/dit_001.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -SPL: Problem with casting to string ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -object(DirectoryIterator)#%d (0) { -} -bool(false) -bool(false) -===DONE=== diff --git a/ext/spl/tests/fileobject_001.phpt b/ext/spl/tests/fileobject_001.phpt deleted file mode 100755 index 957223b169..0000000000 --- a/ext/spl/tests/fileobject_001.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -SPL: SplFileObject::seek'ing ---SKIPIF-- - ---FILE-- -key()); -var_dump($o->current()); -$o->setFlags(SplFileObject::DROP_NEW_LINE); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->next(); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->rewind(); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); -$o->seek(4); -var_dump($o->key()); -var_dump($o->current()); -var_dump($o->key()); - -echo "===A===\n"; -foreach($o as $n => $l) -{ - var_dump($n, $l); -} - -echo "===B===\n"; -$o = new SplFileObject(dirname(__FILE__) . '/fileobject_001b.txt'); -$o->setFlags(SplFileObject::DROP_NEW_LINE); -foreach($o as $n => $l) -{ - var_dump($n, $l); -} - -?> -===DONE=== ---EXPECT-- -int(0) -string(2) "0 -" -int(0) -string(2) "0 -" -int(0) -int(1) -string(1) "1" -int(1) -int(0) -string(1) "0" -int(0) -int(4) -string(1) "4" -int(4) -===A=== -int(0) -string(1) "0" -int(1) -string(1) "1" -int(2) -string(1) "2" -int(3) -string(1) "3" -int(4) -string(1) "4" -int(5) -string(1) "5" -int(6) -string(0) "" -===B=== -int(0) -string(1) "0" -int(1) -string(1) "1" -int(2) -string(1) "2" -int(3) -string(1) "3" -int(4) -string(1) "4" -int(5) -string(1) "5" -===DONE=== diff --git a/ext/spl/tests/fileobject_001a.txt b/ext/spl/tests/fileobject_001a.txt deleted file mode 100755 index e8371f0060..0000000000 --- a/ext/spl/tests/fileobject_001a.txt +++ /dev/null @@ -1,6 +0,0 @@ -0 -1 -2 -3 -4 -5 diff --git a/ext/spl/tests/fileobject_001b.txt b/ext/spl/tests/fileobject_001b.txt deleted file mode 100755 index 0c4a8b5cd3..0000000000 --- a/ext/spl/tests/fileobject_001b.txt +++ /dev/null @@ -1,6 +0,0 @@ -0 -1 -2 -3 -4 -5 \ No newline at end of file diff --git a/ext/spl/tests/fileobject_002.phpt b/ext/spl/tests/fileobject_002.phpt deleted file mode 100755 index 0b944f2a7c..0000000000 --- a/ext/spl/tests/fileobject_002.phpt +++ /dev/null @@ -1,124 +0,0 @@ ---TEST-- -SPL: SplFileObject::fgetc ---SKIPIF-- - ---FILE-- -key()); - while(($c = $o->fgetc()) !== false) - { - var_dump($o->key(), $c, $o->eof()); - } - echo "===EOF?===\n"; - var_dump($o->eof()); - var_dump($o->key()); - var_dump($o->eof()); -} - -test('fileobject_001a.txt'); -test('fileobject_001b.txt'); - -?> -===DONE=== - ---EXPECT-- -===fileobject_001a.txt=== -int(0) -int(0) -string(1) "0" -bool(false) -int(1) -string(1) " -" -bool(false) -int(1) -string(1) "1" -bool(false) -int(2) -string(1) " -" -bool(false) -int(2) -string(1) "2" -bool(false) -int(3) -string(1) " -" -bool(false) -int(3) -string(1) "3" -bool(false) -int(4) -string(1) " -" -bool(false) -int(4) -string(1) "4" -bool(false) -int(5) -string(1) " -" -bool(false) -int(5) -string(1) "5" -bool(false) -int(6) -string(1) " -" -bool(false) -===EOF?=== -bool(true) -int(6) -bool(true) -===fileobject_001b.txt=== -int(0) -int(0) -string(1) "0" -bool(false) -int(1) -string(1) " -" -bool(false) -int(1) -string(1) "1" -bool(false) -int(2) -string(1) " -" -bool(false) -int(2) -string(1) "2" -bool(false) -int(3) -string(1) " -" -bool(false) -int(3) -string(1) "3" -bool(false) -int(4) -string(1) " -" -bool(false) -int(4) -string(1) "4" -bool(false) -int(5) -string(1) " -" -bool(false) -int(5) -string(1) "5" -bool(false) -===EOF?=== -bool(true) -int(5) -bool(true) -===DONE=== diff --git a/ext/spl/tests/fileobject_003.phpt b/ext/spl/tests/fileobject_003.phpt deleted file mode 100755 index 74f2002d00..0000000000 --- a/ext/spl/tests/fileobject_003.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -SPL: SplFileInfo cloning ---SKIPIF-- - ---FILE-- -getPathname() == $c->getPathname()); - - $f = new SplFileObject($name); - var_dump($name); - var_dump($f->getPathName()); - $l = substr($f->getPathName(), -1); - var_dump($l != '/' && $l != '\\' && $l == $lc); - var_dump($f->getFileName()); - $l = substr($f->getFileName(), -1); - var_dump($l != '/' && $l != '\\' && $l == $lc); - var_dump($f->getPath()); - $l = substr($f->getPath(), -1); - var_dump($l != '/' && $l != '\\' && $l == $lp); -} - -test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1)); -test(dirname(__FILE__) . '/', substr(dirname(__FILE__),-1), 'l'); -test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l'); - -?> -===DONE=== - ---EXPECTF-- -===0=== -object(SplFileInfo)#%d (0) { -} -object(SplFileInfo)#%d (0) { -} -bool(false) -bool(true) -bool(true) -string(%d) "%sfileobject_001a.txt" -string(%d) "%sfileobject_001a.txt" -bool(true) -string(%d) "%sfileobject_001a.txt" -bool(true) -string(%d) "%stests" -bool(true) -===1=== -object(SplFileInfo)#%d (0) { -} -object(SplFileInfo)#%d (0) { -} -bool(false) -bool(true) -bool(true) -string(%d) "%stests/" -string(%d) "%stests" -bool(true) -string(%d) "%stests" -bool(true) -string(%d) "%sspl" -bool(true) -===2=== -object(SplFileInfo)#1 (0) { -} -object(SplFileInfo)#2 (0) { -} -bool(false) -bool(true) -bool(true) -string(%d) "%stests" -string(%d) "%stests" -bool(true) -string(%d) "%stests" -bool(true) -string(%d) "%sspl" -bool(true) -===DONE=== diff --git a/ext/spl/tests/iterator_001.phpt b/ext/spl/tests/iterator_001.phpt deleted file mode 100755 index 2239417778..0000000000 --- a/ext/spl/tests/iterator_001.phpt +++ /dev/null @@ -1,173 +0,0 @@ ---TEST-- -SPL: Iterator aggregating inner iterator's methods ---SKIPIF-- - ---FILE-- -a = $a; - } - - public function rewind() - { - echo __METHOD__ . "\n"; - $this->i = 0; - } - - public function valid() - { - $ret = $this->i < count($this->a); - echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; - return $ret; - } - - public function key() - { - echo __METHOD__ . "\n"; - return $this->i; - } - - public function current() - { - echo __METHOD__ . "\n"; - return $this->a[$this->i]; - } - - public function next() - { - echo __METHOD__ . "\n"; - $this->i++; - } - - public function greaterThan($comp) - { - echo get_class($this) . '::' . __FUNCTION__ . '(' . $comp . ")\n"; - return $this->current() > $comp; - } -} - -class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator -{ - public function seek($index) - { - if ($index < count($this->a)) { - $this->i = $index; - } - echo __METHOD__ . '(' . $index . ")\n"; - } -} - -$a = array(1, 2, 3, 4, 5); -$it = new LimitIterator(new NumericArrayIterator($a), 1, 3); -foreach ($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -echo "===SEEKABLE===\n"; -$a = array(1, 2, 3, 4, 5); -$it = new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3); -foreach($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -echo "===STACKED===\n"; -echo "Shows '2 is greater than 2' because the test is actually done with the current value which is 3.\n"; -$a = array(1, 2, 3, 4, 5); -$it = new CachingIterator(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3)); -foreach($it as $v) -{ - print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -NumericArrayIterator::__construct -NumericArrayIterator::rewind -NumericArrayIterator::valid(true) -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is less than or equal 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -NumericArrayIterator::next -===SEEKABLE=== -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is less than or equal 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -NumericArrayIterator::next -===STACKED=== -Shows '2 is greater than 2' because the test is actually done with the current value which is 3. -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -2 is greater than 2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -3 is greater than 2 -NumericArrayIterator::next -SeekableNumericArrayIterator::greaterThan(2) -NumericArrayIterator::current -4 is greater than 2 -===DONE=== diff --git a/ext/spl/tests/iterator_002.phpt b/ext/spl/tests/iterator_002.phpt deleted file mode 100755 index d56a551c3f..0000000000 --- a/ext/spl/tests/iterator_002.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -SPL: Iterator using getInnerIterator ---SKIPIF-- - ---FILE-- -current()); - } - - function getChildren() - { - return new RecursiceArrayIterator($this->current()); - } -} - -class CrashIterator extends FilterIterator implements RecursiveIterator -{ - function accept() - { - return true; - } - - function hasChildren() - { - return $this->getInnerIterator()->hasChildren(); - } - - function getChildren() - { - return new RecursiceArrayIterator($this->getInnerIterator()->current()); - } -} - -$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); - -$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY); - -foreach ($dir as $file) { - print "$file\n"; -} - -?> -===DONE=== - ---EXPECT-- -1 -21 -221 -222 -231 -3 -===DONE=== diff --git a/ext/spl/tests/iterator_003.phpt b/ext/spl/tests/iterator_003.phpt deleted file mode 100755 index c60776cb33..0000000000 --- a/ext/spl/tests/iterator_003.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -SPL: CachingIterator and __toString() ---SKIPIF-- - ---FILE-- -id = $id; - $this->name = $name; - } - - public function __toString() - { - return $this->id . ', ' . $this->name; - } - - public function getId() - { - return $this->id; - } -} - -class StudentIdFilter extends FilterIterator -{ - private $id; - - public function __construct(ArrayObject $students, Student $other) - { - FilterIterator::__construct($students->getIterator()); - $this->id = $other->getId(); - } - - public function accept() - { - echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; - return $this->current()->getId() == $this->id; - } -} - -class StudentList implements IteratorAggregate -{ - private $students; - - public function __construct() - { - $this->students = new ArrayObject(array()); - } - - public function add(Student $student) - { - if (!$this->contains($student)) { - $this->students[] = $student; - } - } - - public function contains(Student $student) - { - foreach ($this->students as $s) - { - if ($s->getId() == $student->getId()) { - return true; - } - } - return false; - } - - public function getIterator() { - return new CachingIterator($this->students->getIterator(), true); - } -} - -$students = new StudentList(); -$students->add(new Student('01234123', 'Joe')); -$students->add(new Student('00000014', 'Bob')); -$students->add(new Student('00000014', 'Foo')); - -// The goal is to verify we can access the cached string value even if it was -// generated by a call to __toString(). To check this we need to access the -// iterator's __toString() method. -$it = $students->getIterator(); -foreach ($it as $student) { - echo $it->__toString(), "\n"; -} -?> -===DONE=== - ---EXPECT-- -01234123, Joe -00000014, Bob -===DONE=== diff --git a/ext/spl/tests/iterator_004.phpt b/ext/spl/tests/iterator_004.phpt deleted file mode 100755 index 4e6006621b..0000000000 --- a/ext/spl/tests/iterator_004.phpt +++ /dev/null @@ -1,144 +0,0 @@ ---TEST-- -SPL: SeekableIterator and string keys ---SKIPIF-- - ---FILE-- -a = $a; - } - - public function rewind() - { - echo __METHOD__ . "\n"; - $this->i = 0; - } - - public function valid() - { - $ret = $this->i < count($this->a); - echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; - return $ret; - } - - public function key() - { - echo __METHOD__ . "\n"; - return $this->i; - } - - public function current() - { - echo __METHOD__ . "\n"; - return $this->a[$this->i]; - } - - public function next() - { - echo __METHOD__ . "\n"; - $this->i++; - } -} - -class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator -{ - public function seek($index) - { - if ($index < count($this->a)) { - $this->i = $index; - } - echo __METHOD__ . '(' . $index . ")\n"; - } -} - -$a = array(1, 2, 3, 4, 5); -foreach (new LimitIterator(new NumericArrayIterator($a), 1, 3) as $v) -{ - print "$v\n"; -} - -echo "===SEEKABLE===\n"; -$a = array(1, 2, 3, 4, 5); -foreach(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3) as $v) -{ - print "$v\n"; -} - -echo "===SEEKING===\n"; -$a = array(1, 2, 3, 4, 5); -$l = new LimitIterator(new SeekableNumericArrayIterator($a)); -for($i = 1; $i < 4; $i++) -{ - $l->seek($i); - print $l->current() . "\n"; -} - -?> -===DONE=== - ---EXPECT-- -NumericArrayIterator::__construct -NumericArrayIterator::rewind -NumericArrayIterator::valid(true) -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -NumericArrayIterator::next -===SEEKABLE=== -NumericArrayIterator::__construct -NumericArrayIterator::rewind -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -NumericArrayIterator::next -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -NumericArrayIterator::next -===SEEKING=== -NumericArrayIterator::__construct -SeekableNumericArrayIterator::seek(1) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -2 -SeekableNumericArrayIterator::seek(2) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -3 -SeekableNumericArrayIterator::seek(3) -NumericArrayIterator::valid(true) -NumericArrayIterator::current -NumericArrayIterator::key -4 -===DONE=== diff --git a/ext/spl/tests/iterator_005.phpt b/ext/spl/tests/iterator_005.phpt deleted file mode 100755 index 4aae600169..0000000000 --- a/ext/spl/tests/iterator_005.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -SPL: IteratorIterator and ArrayIterator/Object ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -ArrayIteratorEx::rewind -int(0) -int(1) -int(2) -int(3) -ArrayObjectEx::getIterator -int(0) -int(1) -int(2) -int(3) -===DONE=== diff --git a/ext/spl/tests/iterator_006.phpt b/ext/spl/tests/iterator_006.phpt deleted file mode 100755 index 05a1cc5a94..0000000000 --- a/ext/spl/tests/iterator_006.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SPL: IteratorIterator and SimpleXMlElement ---SKIPIF-- - ---FILE-- - - - Hello - World - -'); - -foreach (new IteratorIterator($root->child) as $child) { - echo $child."\n"; -} -?> -===DONE=== - ---EXPECT-- -Hello -World -===DONE=== diff --git a/ext/spl/tests/iterator_007.phpt b/ext/spl/tests/iterator_007.phpt deleted file mode 100755 index eb87977ac9..0000000000 --- a/ext/spl/tests/iterator_007.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -SPL: NoRewindIterator ---SKIPIF-- - ---FILE-- -getInnerIterator() as $v) { - var_dump($v); -} - -echo "===1===\n"; -foreach ($it as $v) { - var_dump($v); -} - -$pos =0; - -$it = new NoRewindIteratorEx(new ArrayIteratorEx(range(0,3))); - -echo "===2===\n"; -foreach ($it as $v) { - var_dump($v); - if ($pos++ > 1) { - break; - } -} - -echo "===3===\n"; -foreach ($it as $v) { - var_dump($v); -} - -echo "===4===\n"; -foreach ($it as $v) { - var_dump($v); -} -?> -===DONE=== - ---EXPECT-- -===0=== -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -int(3) -ArrayIteratorEx::next -ArrayIteratorEx::valid -===1=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===2=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(0) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(1) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(2) -===3=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -int(2) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -NoRewindIteratorEx::current -ArrayIteratorEx::current -int(3) -NoRewindIteratorEx::next -ArrayIteratorEx::next -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===4=== -NoRewindIteratorEx::rewind -NoRewindIteratorEx::valid -ArrayIteratorEx::valid -===DONE=== diff --git a/ext/spl/tests/iterator_008.phpt b/ext/spl/tests/iterator_008.phpt deleted file mode 100755 index 5f3c7d89df..0000000000 --- a/ext/spl/tests/iterator_008.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -SPL: InfiniteIterator ---SKIPIF-- - ---FILE-- - 5) { - break; - } -} - -?> -===DONE=== - ---EXPECT-- -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(1) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(2) -ArrayIteratorEx::next -ArrayIteratorEx::valid -ArrayIteratorEx::rewind -ArrayIteratorEx::valid -ArrayIteratorEx::current -ArrayIteratorEx::key -int(0) -===DONE=== diff --git a/ext/spl/tests/iterator_009.phpt b/ext/spl/tests/iterator_009.phpt deleted file mode 100755 index 27a3e0655f..0000000000 --- a/ext/spl/tests/iterator_009.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -SPL: EmptyIterator ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECT-- -EmptyIteratorEx::rewind -EmptyIteratorEx::valid -===DONE=== diff --git a/ext/spl/tests/iterator_010.phpt b/ext/spl/tests/iterator_010.phpt deleted file mode 100755 index e7e1a519b6..0000000000 --- a/ext/spl/tests/iterator_010.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SPL: EmptyIterator ---SKIPIF-- - ---FILE-- - $val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---FILE-- -$val) -{ - echo "$key=>$val\n"; -} - -echo "===InfiniteIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -echo "===Infinite/LimitIterator===\n"; - -$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); -$it = new LimitIterator($it, 1, 2); -$it = new InfiniteIterator($it); -$it = new LimitIterator($it, 2, 5); -foreach($it as $val=>$key) -{ - echo "$val=>$key\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===EmptyIterator=== -===InfiniteIterator=== -2=>C -3=>D -0=>A -1=>B -2=>C -===Infinite/LimitIterator=== -1=>B -2=>C -1=>B -2=>C -1=>B -===DONE=== diff --git a/ext/spl/tests/iterator_012.phpt b/ext/spl/tests/iterator_012.phpt deleted file mode 100755 index c6eb86eefb..0000000000 --- a/ext/spl/tests/iterator_012.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -SPL: NoRewindIterator ---SKIPIF-- - ---FILE-- - '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=== - ---EXPECTF-- -===Current=== -0=>A -===Next=== -===Foreach=== -1=>B -2=>C -===DONE=== diff --git a/ext/spl/tests/iterator_013.phpt b/ext/spl/tests/iterator_013.phpt deleted file mode 100755 index 56aea98504..0000000000 --- a/ext/spl/tests/iterator_013.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -SPL: AppendIterator ---SKIPIF-- - ---FILE-- -$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B'))); - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Append===\n"; - -$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D'))); - -foreach(new NoRewindIterator($it) as $key=>$val) -{ - echo "$key=>$val\n"; -} - -echo "===Rewind===\n"; - -foreach($it as $key=>$val) -{ - echo "$key=>$val\n"; -} - -?> -===DONE=== - ---EXPECTF-- -===Empty=== -===Append=== -0=>A -1=>B -===Rewind=== -0=>A -1=>B -===Append=== -2=>C -3=>D -===Rewind=== -0=>A -1=>B -2=>C -3=>D -===DONE=== diff --git a/ext/spl/tests/iterator_014.phpt b/ext/spl/tests/iterator_014.phpt deleted file mode 100755 index 8f9020bf81..0000000000 --- a/ext/spl/tests/iterator_014.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and beginChildren/endChildren ---SKIPIF-- - ---FILE-- -getDepth().")\n"; - } - - function endChildren() - { - echo __METHOD__ . "(".$this->getDepth().")\n"; - } -} - -foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"))) as $k=>$v) -{ - echo "$k=>$v\n"; -} -?> -===DONE=== - ---EXPECT-- -RecursiveArrayIteratorIterator::rewind -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>a -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ba -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bba -RecursiveArrayIteratorIterator::next -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -1=>bbb -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(2) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(3) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>bcaa -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(3) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(2) -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -MyRecursiveArrayIterator::getChildren -RecursiveArrayIteratorIterator::beginChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -0=>ca -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::endChildren(1) -RecursiveArrayIteratorIterator::valid -RecursiveArrayIteratorIterator::current -RecursiveArrayIteratorIterator::key -3=>d -RecursiveArrayIteratorIterator::next -MyRecursiveArrayIterator::valid = false -RecursiveArrayIteratorIterator::valid -MyRecursiveArrayIterator::valid = false -===DONE=== diff --git a/ext/spl/tests/iterator_015.phpt b/ext/spl/tests/iterator_015.phpt deleted file mode 100755 index 57b9899e6c..0000000000 --- a/ext/spl/tests/iterator_015.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -SPL: RecursiveIteratorIterator and beginChildren/endChildren ---SKIPIF-- - ---FILE-- -\n"; - parent::rewind(); - } - function beginChildren() - { - echo str_repeat(' ',$this->getDepth())."\n"; - } - function valid() - { - if (!parent::valid()) { - echo "