From: Raghubansh Kumar Date: Fri, 19 Oct 2007 18:31:16 +0000 (+0000) Subject: New testcases for array_fill() function X-Git-Tag: RELEASE_1_3_1~825 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd465b457ca6da798a8fc742c0a0ca3098eb5385;p=php New testcases for array_fill() function --- diff --git a/ext/standard/tests/array/array_fill_basic.phpt b/ext/standard/tests/array/array_fill_basic.phpt new file mode 100644 index 0000000000..415bbf606a --- /dev/null +++ b/ext/standard/tests/array/array_fill_basic.phpt @@ -0,0 +1,97 @@ +--TEST-- +Test array_fill() function : basic functionality +--FILE-- + +--EXPECTF-- +*** Testing array_fill() : basic functionality *** +-- Iteration 1 -- +array(2) { + [0]=> + NULL + [1]=> + NULL +} +-- Iteration 2 -- +array(2) { + [0]=> + int(0) + [1]=> + int(0) +} +-- Iteration 3 -- +array(2) { + [0]=> + int(1) + [1]=> + int(1) +} +-- Iteration 4 -- +array(2) { + [0]=> + float(1.5) + [1]=> + float(1.5) +} +-- Iteration 5 -- +array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" +} +-- Iteration 6 -- +array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" +} +-- Iteration 7 -- +array(2) { + [0]=> + string(5) "Hello" + [1]=> + string(5) "Hello" +} +Done diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt new file mode 100644 index 0000000000..9992009f09 --- /dev/null +++ b/ext/standard/tests/array/array_fill_error.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test array_fill() function : error conditions +--FILE-- + +--EXPECTF-- +*** Testing array_fill() : error conditions *** +-- Testing array_fill() function with Zero arguments -- + +Warning: Wrong parameter count for array_fill() in %s on line %d +NULL +-- Testing array_fill() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for array_fill() in %s on line %d +NULL +-- Testing array_fill() function with less than expected no. of arguments -- + +Warning: Wrong parameter count for array_fill() in %s on line %d +NULL + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/array/array_fill_object.phpt b/ext/standard/tests/array/array_fill_object.phpt new file mode 100644 index 0000000000..0714962c1c --- /dev/null +++ b/ext/standard/tests/array/array_fill_object.phpt @@ -0,0 +1,432 @@ +--TEST-- +Test array_fill() function : usage variations - various object values for 'val' argument +--FILE-- +member1 = $value1; + $this->var2 = $value2; + } +} + +// child class which inherits parent class test1 +class Child_test1 extends Test1 +{ + public $member2; + + function __construct($value1, $value2, $value3) + { + parent::__construct($value1, $value2); + $this->member2 = $value3; + } +} + +//class with private, static, constant members and constructor to initialize the private member +class Test2 +{ + const test2_constant = "test2"; + public static $test2_static = 0; + private $member1; + var $var1 = 30; + var $var2; + + function __construct($value1,$value2) + { + $this->member1 = $value1; + $this->var2 = $value2; + } +} + +// child class which inherits parent class test2 +class Child_test2 extends Test2 +{ + private $member1; + + function __construct($value1, $value2, $value3) + { + parent::__construct($value1, $value2); + $this->member1 = $value3; + } +} + +// class with protected, static, constant members and consturctor to initialize the protected member +class Test3 +{ + const test3_constant = "test3"; + public static $test3_static = 0; + protected $member1; + var $var1 = 30; + var $var2; + + function __construct($value1, $value2) + { + $this->member1 = $value1; + $this->var2 = $value2; + } +} + +// child class which inherits parent class test3 +class Child_test3 extends Test3 +{ + protected $member1; + + function __construct($value1, $value2, $value3) + { + parent::__construct($value1, $value2); + $this->member1 = $value3; + } +} + +// class with public, private, protected members, static, constant members and constructor to initialize all the members +class Test4 +{ + const test4_constant = "test4"; + public static $test4_static = 0; + public $member1; + private $member2; + protected $member3; + + function __construct($value1, $value2, $value3) + { + $this->member1 = $value1; + $this->member2 = $value2; + $this->member3 = $value3; + } +} + +// child class which inherits parent class test4 +class Child_test4 extends Test4 +{ + var $var1; + + function __construct($value1, $value2, $value3, $value4) + { + parent::__construct($value1, $value2, $value3); + $this->var1 = $value4; + } +} + +// abstract class with public, private, protected members +abstract class AbstractClass +{ + public $member1; + private $member2; + protected $member3; + var $var1 = 30; + + abstract protected function display(); +} + +// implement abstract 'AbstractClass' class +class ConcreteClass1 extends AbstractClass +{ + protected function display() + { + echo "class name is ConcreteClass1 \n"; + } +} + + +// declarationn of the interface 'iTemplate' +interface iTemplate +{ + public function display(); +} + +// implement the interface 'iTemplate' +class Template1 implements iTemplate +{ + public function display() + { + echo "class name is Template1\n"; + } +} + +//array of object values for 'val' argument +$objects = array( + + /* 1 */ new Test(), + new Test1(100 , 101), + new Child_test1(100 , 101 , 102), + new Test2(100 , 101), + /* 5 */ new Child_test2(100 , 101 , 102), + new Test3(100 , 101), + new Child_test3(100 , 101 , 102), + new Test4( 100 , 101 , 102), + new Child_test4(100 , 101 , 102 , 103), + new ConcreteClass1(), + /* 11 */ new Template1() +); + +// loop through each element of the array for 'val' argument +// check the working of array_fill() +echo "--- Testing array_fill() with different object values for 'val' argument ---\n"; +$counter = 1; +for($index = 0; $index < count($objects); $index ++) +{ + echo "-- Iteration $counter --\n"; + $val = $objects[$index]; + + var_dump( array_fill($start_key, $num, $val) ); + + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing array_fill() : usage variations *** +--- Testing array_fill() with different object values for 'val' argument --- +-- Iteration 1 -- +array(2) { + [0]=> + object(Test)#%d (0) { + } + [1]=> + object(Test)#%d (0) { + } +} +-- Iteration 2 -- +array(2) { + [0]=> + object(Test1)#%d (3) { + ["member1"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Test1)#%d (3) { + ["member1"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 3 -- +array(2) { + [0]=> + object(Child_test1)#%d (4) { + ["member2"]=> + int(102) + ["member1"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Child_test1)#%d (4) { + ["member2"]=> + int(102) + ["member1"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 4 -- +array(2) { + [0]=> + object(Test2)#%d (3) { + ["member1:private"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Test2)#%d (3) { + ["member1:private"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 5 -- +array(2) { + [0]=> + object(Child_test2)#%d (4) { + ["member1:private"]=> + int(102) + ["member1:private"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Child_test2)#%d (4) { + ["member1:private"]=> + int(102) + ["member1:private"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 6 -- +array(2) { + [0]=> + object(Test3)#%d (3) { + ["member1:protected"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Test3)#%d (3) { + ["member1:protected"]=> + int(100) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 7 -- +array(2) { + [0]=> + object(Child_test3)#%d (3) { + ["member1:protected"]=> + int(102) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } + [1]=> + object(Child_test3)#%d (3) { + ["member1:protected"]=> + int(102) + ["var1"]=> + int(30) + ["var2"]=> + int(101) + } +} +-- Iteration 8 -- +array(2) { + [0]=> + object(Test4)#%d (3) { + ["member1"]=> + int(100) + ["member2:private"]=> + int(101) + ["member3:protected"]=> + int(102) + } + [1]=> + object(Test4)#%d (3) { + ["member1"]=> + int(100) + ["member2:private"]=> + int(101) + ["member3:protected"]=> + int(102) + } +} +-- Iteration 9 -- +array(2) { + [0]=> + object(Child_test4)#%d (4) { + ["var1"]=> + int(103) + ["member1"]=> + int(100) + ["member2:private"]=> + int(101) + ["member3:protected"]=> + int(102) + } + [1]=> + object(Child_test4)#%d (4) { + ["var1"]=> + int(103) + ["member1"]=> + int(100) + ["member2:private"]=> + int(101) + ["member3:protected"]=> + int(102) + } +} +-- Iteration 10 -- +array(2) { + [0]=> + object(ConcreteClass1)#%d (4) { + ["member1"]=> + NULL + ["member2:private"]=> + NULL + ["member3:protected"]=> + NULL + ["var1"]=> + int(30) + } + [1]=> + object(ConcreteClass1)#%d (4) { + ["member1"]=> + NULL + ["member2:private"]=> + NULL + ["member3:protected"]=> + NULL + ["var1"]=> + int(30) + } +} +-- Iteration 11 -- +array(2) { + [0]=> + object(Template1)#%d (0) { + } + [1]=> + object(Template1)#%d (0) { + } +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/array_fill_variation1.phpt b/ext/standard/tests/array/array_fill_variation1.phpt new file mode 100644 index 0000000000..b265f63834 --- /dev/null +++ b/ext/standard/tests/array/array_fill_variation1.phpt @@ -0,0 +1,255 @@ +--TEST-- +Test array_fill() function : usage variations - unexpected values for 'start_key' argument(Bug#43017) +--FILE-- + 'red', 'item' => 'pen'), + + // null values + /* 11 */ NULL, + null, + + // boolean values + /* 13 */ true, + false, + TRUE, + FALSE, + + // empty string + /* 17 */ "", + '', + + // string values + /* 19 */ "string", + 'string', + + // objects + /* 21 */ new test(), + + // undefined variable + @$undefined_var, + + // unset variable + @$unset_var, + + // resource variable + /* 24 */ $fp +); + +// loop through each element of the array for start_key +// check the working of array_fill() +echo "--- Testing array_fill() with different values for 'start_key' arg ---\n"; +$counter = 1; +for($index = 0; $index < count($values); $index ++) +{ + echo "-- Iteration $counter --\n"; + $start_key = $values[$index]; + + var_dump( array_fill($start_key,$num,$val) ); + + $counter ++; +} + +// close the resource used +fclose($fp); + +echo "Done"; +?> +--EXPECTF-- +*** Testing array_fill() : usage variations *** +--- Testing array_fill() with different values for 'start_key' arg --- +-- Iteration 1 -- +array(2) { + [10]=> + int(100) + [11]=> + int(100) +} +-- Iteration 2 -- +array(2) { + [-10]=> + int(100) + [0]=> + int(100) +} +-- Iteration 3 -- +array(2) { + [-1097262584]=> + int(100) + [0]=> + int(100) +} +-- Iteration 4 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 5 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 6 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 7 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 8 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 9 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 10 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 11 -- + +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 12 -- + +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 13 -- + +array(2) { + [1]=> + int(100) + [2]=> + int(100) +} +-- Iteration 14 -- + +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 15 -- + +array(2) { + [1]=> + int(100) + [2]=> + int(100) +} +-- Iteration 16 -- + +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 17 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 18 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 19 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 20 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 21 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 22 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 23 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +-- Iteration 24 -- + +Warning: array_fill(): Wrong data type for start key in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/array/array_fill_variation2.phpt b/ext/standard/tests/array/array_fill_variation2.phpt new file mode 100644 index 0000000000..9eb635fded --- /dev/null +++ b/ext/standard/tests/array/array_fill_variation2.phpt @@ -0,0 +1,213 @@ +--TEST-- +Test array_fill() function : usage variations - unexpected values for 'num' argument +--FILE-- + 'red', 'item' => 'pen'), + + // null values + /* 11 */ NULL, + null, + + // boolean values + /* 13 */ true, + false, + TRUE, + FALSE, + + // empty string + /* 17 */ "", + '', + + // string values + /* 19 */ "string", + 'string', + + // objects + /* 21 */ new test(), + + // undefined variable + @$undefined_var, + + // unset variable + /* 23 */ @$unset_var, + +); + +// loop through each element of the array for num +// check the working of array_fill +echo "--- Testing array_fill() with different values for 'num' arg ---\n"; +$counter = 1; +for($index = 0; $index < count($values); $index ++) +{ + echo "-- Iteration $counter --\n"; + $num = $values[$index]; + + var_dump( array_fill($start_key, $num, $val) ); + + $counter ++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing array_fill() : usage variations *** +--- Testing array_fill() with different values for 'num' arg --- +-- Iteration 1 -- +array(2) { + [0]=> + int(100) + [1]=> + int(100) +} +-- Iteration 2 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 3 -- +array(5) { + [0]=> + int(100) + [1]=> + int(100) + [2]=> + int(100) + [3]=> + int(100) + [4]=> + int(100) +} +-- Iteration 4 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 5 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 6 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 7 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 8 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 9 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 10 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 11 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 12 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 13 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 14 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 15 -- +array(1) { + [0]=> + int(100) +} +-- Iteration 16 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 17 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 18 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 19 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 20 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 21 -- + +Notice: Object of class test could not be converted to int in %s on line %d +array(1) { + [0]=> + int(100) +} +-- Iteration 22 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +-- Iteration 23 -- + +Warning: array_fill(): Number of elements must be positive in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/array/array_fill_variation3.phpt b/ext/standard/tests/array/array_fill_variation3.phpt new file mode 100644 index 0000000000..fbb22d8696 --- /dev/null +++ b/ext/standard/tests/array/array_fill_variation3.phpt @@ -0,0 +1,110 @@ +--TEST-- +Test array_fill() function : usage variations - unexpected values for 'val' argument +--FILE-- + +--EXPECTF-- +*** Testing array_fill() : usage variations *** +--- Testing array_fill() with different values for 'val' argument --- +-- Iteration 1 -- +array(2) { + [0]=> + string(0) "" + [1]=> + string(0) "" +} +-- Iteration 2 -- +array(2) { + [0]=> + string(0) "" + [1]=> + string(0) "" +} +-- Iteration 3 -- +array(2) { + [0]=> + object(test)#%d (1) { + ["t"]=> + int(10) + } + [1]=> + object(test)#%d (1) { + ["t"]=> + int(10) + } +} +-- Iteration 4 -- +array(2) { + [0]=> + NULL + [1]=> + NULL +} +-- Iteration 5 -- +array(2) { + [0]=> + NULL + [1]=> + NULL +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/array_fill_variation4.phpt b/ext/standard/tests/array/array_fill_variation4.phpt new file mode 100644 index 0000000000..247761db37 --- /dev/null +++ b/ext/standard/tests/array/array_fill_variation4.phpt @@ -0,0 +1,168 @@ +--TEST-- +Test array_fill() function : usage variations - using return value of array_fill as 'val' arugment +--FILE-- + +--EXPECTF-- +*** Testing array_fill() : variation *** +*** Filling 2 dimensional array with all basic valid values *** +-- Iteration 1 -- +array(2) { + [0]=> + array(2) { + [0]=> + NULL + [1]=> + NULL + } + [1]=> + array(2) { + [0]=> + NULL + [1]=> + NULL + } +} +-- Iteration 2 -- +array(2) { + [0]=> + array(2) { + [0]=> + int(0) + [1]=> + int(0) + } + [1]=> + array(2) { + [0]=> + int(0) + [1]=> + int(0) + } +} +-- Iteration 3 -- +array(2) { + [0]=> + array(2) { + [0]=> + int(1) + [1]=> + int(1) + } + [1]=> + array(2) { + [0]=> + int(1) + [1]=> + int(1) + } +} +-- Iteration 4 -- +array(2) { + [0]=> + array(2) { + [0]=> + float(1) + [1]=> + float(1) + } + [1]=> + array(2) { + [0]=> + float(1) + [1]=> + float(1) + } +} +-- Iteration 5 -- +array(2) { + [0]=> + array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" + } + [1]=> + array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" + } +} +-- Iteration 6 -- +array(2) { + [0]=> + array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" + } + [1]=> + array(2) { + [0]=> + string(2) "hi" + [1]=> + string(2) "hi" + } +} +-- Iteration 7 -- +array(2) { + [0]=> + array(2) { + [0]=> + string(5) "Hello" + [1]=> + string(5) "Hello" + } + [1]=> + array(2) { + [0]=> + string(5) "Hello" + [1]=> + string(5) "Hello" + } +} +Done diff --git a/ext/standard/tests/array/array_fill_variation5.phpt b/ext/standard/tests/array/array_fill_variation5.phpt new file mode 100644 index 0000000000..6260c36bd6 --- /dev/null +++ b/ext/standard/tests/array/array_fill_variation5.phpt @@ -0,0 +1,291 @@ +--TEST-- +Test array_fill() function : usage variations - different types of array values for 'val' argument +--FILE-- + "Hi" , 2 => "Hello"), + array("Saffron" , "White" , "Green"), + /* 5 */ array('color' => 'red' , 'item' => 'pen'), + array( 'color' => 'red' , 2 => 'green ' ), + array("colour" => "red" , "item" => "pen"), + array( TRUE => "red" , FALSE => "green" ), + array( true => "red" , FALSE => "green" ), + /* 10 */ array( 1 => "Hi" , "color" => "red" , 'item' => 'pen'), + array( NULL => "Hi", '1' => "Hello" , "1" => "Green"), + array( ""=>1, "color" => "green"), + /* 13 */ array('Saffron' , 'White' , 'Green') +); + +// loop through each element of the values array for 'val' argument +// check the working of array_fill() +echo "--- Testing array_fill() with different types of array values for 'val' argument ---\n"; +$counter = 1; +for($i = 0; $i < count($values); $i++) +{ + echo "-- Iteration $counter --\n"; + $val = $values[$i]; + + var_dump( array_fill($start_key, $num, $val) ); + + $counter++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing array_fill() : usage variations *** +--- Testing array_fill() with different types of array values for 'val' argument --- +-- Iteration 1 -- +array(2) { + [0]=> + array(0) { + } + [1]=> + array(0) { + } +} +-- Iteration 2 -- +array(2) { + [0]=> + array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + } + [1]=> + array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + } +} +-- Iteration 3 -- +array(2) { + [0]=> + array(2) { + [1]=> + string(2) "Hi" + [2]=> + string(5) "Hello" + } + [1]=> + array(2) { + [1]=> + string(2) "Hi" + [2]=> + string(5) "Hello" + } +} +-- Iteration 4 -- +array(2) { + [0]=> + array(3) { + [0]=> + string(7) "Saffron" + [1]=> + string(5) "White" + [2]=> + string(5) "Green" + } + [1]=> + array(3) { + [0]=> + string(7) "Saffron" + [1]=> + string(5) "White" + [2]=> + string(5) "Green" + } +} +-- Iteration 5 -- +array(2) { + [0]=> + array(2) { + ["color"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } + [1]=> + array(2) { + ["color"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } +} +-- Iteration 6 -- +array(2) { + [0]=> + array(2) { + ["color"]=> + string(3) "red" + [2]=> + string(6) "green " + } + [1]=> + array(2) { + ["color"]=> + string(3) "red" + [2]=> + string(6) "green " + } +} +-- Iteration 7 -- +array(2) { + [0]=> + array(2) { + ["colour"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } + [1]=> + array(2) { + ["colour"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } +} +-- Iteration 8 -- +array(2) { + [0]=> + array(2) { + [1]=> + string(3) "red" + [0]=> + string(5) "green" + } + [1]=> + array(2) { + [1]=> + string(3) "red" + [0]=> + string(5) "green" + } +} +-- Iteration 9 -- +array(2) { + [0]=> + array(2) { + [1]=> + string(3) "red" + [0]=> + string(5) "green" + } + [1]=> + array(2) { + [1]=> + string(3) "red" + [0]=> + string(5) "green" + } +} +-- Iteration 10 -- +array(2) { + [0]=> + array(3) { + [1]=> + string(2) "Hi" + ["color"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } + [1]=> + array(3) { + [1]=> + string(2) "Hi" + ["color"]=> + string(3) "red" + ["item"]=> + string(3) "pen" + } +} +-- Iteration 11 -- +array(2) { + [0]=> + array(2) { + [""]=> + string(2) "Hi" + [1]=> + string(5) "Green" + } + [1]=> + array(2) { + [""]=> + string(2) "Hi" + [1]=> + string(5) "Green" + } +} +-- Iteration 12 -- +array(2) { + [0]=> + array(2) { + [""]=> + int(1) + ["color"]=> + string(5) "green" + } + [1]=> + array(2) { + [""]=> + int(1) + ["color"]=> + string(5) "green" + } +} +-- Iteration 13 -- +array(2) { + [0]=> + array(3) { + [0]=> + string(7) "Saffron" + [1]=> + string(5) "White" + [2]=> + string(5) "Green" + } + [1]=> + array(3) { + [0]=> + string(7) "Saffron" + [1]=> + string(5) "White" + [2]=> + string(5) "Green" + } +} +Done