diff options
81 files changed, 1845 insertions, 2483 deletions
diff --git a/ext/standard/tests/array/005.phpt b/ext/standard/tests/array/005.phpt index 523db69ece..40e9eac265 100644 --- a/ext/standard/tests/array/005.phpt +++ b/ext/standard/tests/array/005.phpt @@ -17,12 +17,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ) + 5 => 57, "5.4" => 554, "5.7" => 557 ) ); /* Testing Error Conditions */ @@ -36,8 +36,8 @@ echo "\n*** Testing with various array inputs ***\n"; $counter = 1; foreach( $mixed_array as $sub_array ) { - echo "\n-- Input Array for Iteration $counter is -- \n"; - print_r( $sub_array ); + echo "\n-- Input Array for Iteration $counter is --\n"; + var_dump( $sub_array ); echo "\nOutput after shift is :\n"; var_dump( array_shift($sub_array) ); $counter++; @@ -47,19 +47,19 @@ foreach( $mixed_array as $sub_array ) { echo"\n*** Checking for internal array pointer being reset when shift is called ***\n"; -echo "\nCurrent Element is : "; +echo "\nCurrent Element is :"; var_dump( current($mixed_array[1]) ); -echo "\nNext Element is : "; +echo "\nNext Element is :"; var_dump( next($mixed_array[1]) ); -echo "\nNext Element is : "; +echo "\nNext Element is :"; var_dump( next($mixed_array[1]) ); -echo "\nshifted Element is : "; +echo "\nshifted Element is :"; var_dump( array_shift($mixed_array[1]) ); -echo "\nCurrent Element after shift operation is: "; +echo "\nCurrent Element after shift operation is:"; var_dump( current($mixed_array[1]) ); echo"Done"; @@ -70,155 +70,203 @@ NULL *** Testing with various array inputs *** --- Input Array for Iteration 1 is -- -Array -( -) +-- Input Array for Iteration 1 is -- +array(0) { +} Output after shift is : NULL --- Input Array for Iteration 2 is -- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [3] => 4 - [4] => 5 - [5] => 6 - [6] => 7 - [7] => 8 - [8] => 9 -) +-- Input Array for Iteration 2 is -- +array(9) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) +} Output after shift is : int(1) --- Input Array for Iteration 3 is -- -Array -( - [0] => One - [1] => _Two - [2] => Three - [3] => Four - [4] => Five -) +-- Input Array for Iteration 3 is -- +array(5) { + [0]=> + string(3) "One" + [1]=> + string(4) "_Two" + [2]=> + string(5) "Three" + [3]=> + string(4) "Four" + [4]=> + string(4) "Five" +} Output after shift is : string(3) "One" --- Input Array for Iteration 4 is -- -Array -( - [0] => 6 - [1] => six - [2] => 7 - [3] => seven - [4] => 8 - [5] => eight - [6] => 9 - [7] => nine -) +-- Input Array for Iteration 4 is -- +array(8) { + [0]=> + int(6) + [1]=> + string(3) "six" + [2]=> + int(7) + [3]=> + string(5) "seven" + [4]=> + int(8) + [5]=> + string(5) "eight" + [6]=> + int(9) + [7]=> + string(4) "nine" +} Output after shift is : int(6) --- Input Array for Iteration 5 is -- -Array -( - [a] => aaa - [A] => AAA - [c] => ccc - [d] => ddd - [e] => eee -) +-- Input Array for Iteration 5 is -- +array(5) { + ["a"]=> + string(3) "aaa" + ["A"]=> + string(3) "AAA" + ["c"]=> + string(3) "ccc" + ["d"]=> + string(3) "ddd" + ["e"]=> + string(3) "eee" +} Output after shift is : string(3) "aaa" --- Input Array for Iteration 6 is -- -Array -( - [1] => one - [2] => two - [3] => three - [4] => four - [5] => five -) +-- Input Array for Iteration 6 is -- +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after shift is : string(3) "one" --- Input Array for Iteration 7 is -- -Array -( - [1] => one - [2] => two - [3] => 7 - [4] => four - [5] => five -) +-- Input Array for Iteration 7 is -- +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + int(7) + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after shift is : string(3) "one" --- Input Array for Iteration 8 is -- -Array -( - [f] => fff - [1] => one - [4] => 6 - [] => 3 - [2] => float - [F] => FFF - [blank] => - [3] => 3.7 - [5] => Five - [6] => 8.6 - [4name] => jonny - [a] => -) +-- Input Array for Iteration 8 is -- +array(12) { + ["f"]=> + string(3) "fff" + [1]=> + string(3) "one" + [4]=> + int(6) + [""]=> + int(3) + [2]=> + string(5) "float" + ["F"]=> + string(3) "FFF" + ["blank"]=> + string(0) "" + [3]=> + float(3.7) + [5]=> + string(4) "Five" + [6]=> + float(8.6) + ["4name"]=> + string(5) "jonny" + ["a"]=> + NULL +} Output after shift is : string(3) "fff" --- Input Array for Iteration 9 is -- -Array -( - [0] => 12 - [1] => name - [2] => age - [3] => 45 -) +-- Input Array for Iteration 9 is -- +array(4) { + [0]=> + int(12) + [1]=> + string(4) "name" + [2]=> + string(3) "age" + [3]=> + string(2) "45" +} Output after shift is : int(12) --- Input Array for Iteration 10 is -- -Array -( - [0] => Array - ( - [0] => oNe - [1] => tWo - [2] => 4 - ) - - [1] => Array - ( - [0] => 10 - [1] => 20 - [2] => 30 - [3] => 40 - [4] => 50 - ) - - [2] => Array - ( - ) - -) +-- Input Array for Iteration 10 is -- +array(3) { + [0]=> + array(3) { + [0]=> + string(3) "oNe" + [1]=> + string(3) "tWo" + [2]=> + int(4) + } + [1]=> + array(5) { + [0]=> + int(10) + [1]=> + int(20) + [2]=> + int(30) + [3]=> + int(40) + [4]=> + int(50) + } + [2]=> + array(0) { + } +} Output after shift is : array(3) { @@ -230,33 +278,42 @@ array(3) { int(4) } --- Input Array for Iteration 11 is -- -Array -( - [one] => 2 - [three] => 3 - [0] => 3 - [1] => 4 - [3] => 33 - [4] => 44 - [5] => 57 - [6] => 6 - [5.4] => 554 - [5.7] => 557 -) +-- Input Array for Iteration 11 is -- +array(10) { + ["one"]=> + int(2) + ["three"]=> + int(3) + [0]=> + int(3) + [1]=> + int(4) + [3]=> + int(33) + [4]=> + int(44) + [5]=> + int(57) + [6]=> + int(6) + ["5.4"]=> + int(554) + ["5.7"]=> + int(557) +} Output after shift is : int(2) *** Checking for internal array pointer being reset when shift is called *** -Current Element is : int(1) +Current Element is :int(1) -Next Element is : int(2) +Next Element is :int(2) -Next Element is : int(3) +Next Element is :int(3) -shifted Element is : int(1) +shifted Element is :int(1) -Current Element after shift operation is: int(2) +Current Element after shift operation is:int(2) Done diff --git a/ext/standard/tests/array/009.phpt b/ext/standard/tests/array/009.phpt index 42cecc51ea..f4aab2fa93 100644 --- a/ext/standard/tests/array/009.phpt +++ b/ext/standard/tests/array/009.phpt @@ -20,7 +20,7 @@ $varient_arrays = array ( array(NULL),// array with NULL array(null),// array with null array(NULL, true, null, "", 1), // mixed array - array(-1.5 => "test", -2 => "rest", 2.5 => "two", + array(-1 => "test", -2 => "rest", 2 => "two", "" => "string", 0 => "zero", "" => "" ) // mixed array ); diff --git a/ext/standard/tests/array/array_change_key_case_variation3.phpt b/ext/standard/tests/array/array_change_key_case_variation3.phpt index bd5ad8557b..0c3ed4eb0d 100644 --- a/ext/standard/tests/array/array_change_key_case_variation3.phpt +++ b/ext/standard/tests/array/array_change_key_case_variation3.phpt @@ -29,18 +29,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - - 'extreme floats' => array( - 12.3456789000e6 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*3*/ 'null uppercase' => array( NULL => 'null 1', @@ -110,37 +98,19 @@ array(4) { string(8) "negative" } --- Iteration 2 : float data -- -array(3) { - [10]=> - string(8) "positive" - [-10]=> - string(8) "negative" - [0]=> - string(4) "half" -} - --- Iteration 3 : extreme floats data -- -array(2) { - [12345678]=> - string(5) "large" - [0]=> - string(5) "small" -} - --- Iteration 4 : null uppercase data -- +-- Iteration 2 : null uppercase data -- array(1) { [""]=> string(6) "null 1" } --- Iteration 5 : null lowercase data -- +-- Iteration 3 : null lowercase data -- array(1) { [""]=> string(6) "null 2" } --- Iteration 6 : bool lowercase data -- +-- Iteration 4 : bool lowercase data -- array(2) { [1]=> string(6) "lowert" @@ -148,7 +118,7 @@ array(2) { string(6) "lowerf" } --- Iteration 7 : bool uppercase data -- +-- Iteration 5 : bool uppercase data -- array(2) { [1]=> string(6) "uppert" @@ -156,19 +126,19 @@ array(2) { string(6) "upperf" } --- Iteration 8 : empty double quotes data -- +-- Iteration 6 : empty double quotes data -- array(1) { [""]=> string(6) "emptyd" } --- Iteration 9 : empty single quotes data -- +-- Iteration 7 : empty single quotes data -- array(1) { [""]=> string(6) "emptys" } --- Iteration 10 : string data -- +-- Iteration 8 : string data -- array(3) { ["STRINGD"]=> string(7) "stringd" @@ -178,13 +148,13 @@ array(3) { string(7) "stringh" } --- Iteration 11 : undefined data -- +-- Iteration 9 : undefined data -- array(1) { [""]=> string(9) "undefined" } --- Iteration 12 : unset data -- +-- Iteration 10 : unset data -- array(1) { [""]=> string(5) "unset" diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt index 24123b0370..dfae48974d 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -16,7 +16,7 @@ echo "*** Testing array_chunk() : usage variations ***\n"; $input_array = array(1, 2, 3); // different magnitude's -$sizes = array(-1, count($input_array) + 1, 0, 1.5); +$sizes = array(-1, count($input_array) + 1, 0, 1); // loop through the array for size argument foreach ($sizes as $size){ @@ -86,7 +86,7 @@ array_chunk(): Argument #2 ($length) must be greater than 0 array_chunk(): Argument #2 ($length) must be greater than 0 array_chunk(): Argument #2 ($length) must be greater than 0 --- Testing array_chunk() when size = 1.5 -- +-- Testing array_chunk() when size = 1 -- array(3) { [0]=> array(1) { diff --git a/ext/standard/tests/array/array_combine_variation4.phpt b/ext/standard/tests/array/array_combine_variation4.phpt index e853d9e2fe..ae4d54a626 100644 --- a/ext/standard/tests/array/array_combine_variation4.phpt +++ b/ext/standard/tests/array/array_combine_variation4.phpt @@ -40,12 +40,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -112,22 +106,6 @@ array(4) { string(1) "4" } -- Iteration 5 -- -array(1) { - ["float"]=> - string(5) "float" -} --- Iteration 6 -- -array(4) { - ["f1"]=> - string(2) "f1" - ["f2"]=> - string(2) "f2" - ["f3"]=> - string(2) "f3" - ["f4"]=> - string(2) "f4" -} --- Iteration 7 -- array(4) { [111]=> int(111) @@ -138,7 +116,7 @@ array(4) { [33]=> int(33) } --- Iteration 8 -- +-- Iteration 6 -- array(4) { [111]=> int(111) @@ -149,21 +127,21 @@ array(4) { [33]=> int(33) } --- Iteration 9 -- +-- Iteration 7 -- array(2) { ["hello"]=> string(5) "hello" ["string"]=> string(6) "string" } --- Iteration 10 -- +-- Iteration 8 -- array(2) { ["hello"]=> string(5) "hello" ["resource"]=> string(8) "resource" } --- Iteration 11 -- +-- Iteration 9 -- array(7) { [1]=> int(1) diff --git a/ext/standard/tests/array/array_combine_variation5.phpt b/ext/standard/tests/array/array_combine_variation5.phpt index ec92352a07..ef0859373e 100644 --- a/ext/standard/tests/array/array_combine_variation5.phpt +++ b/ext/standard/tests/array/array_combine_variation5.phpt @@ -46,8 +46,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_diff_assoc_variation4.phpt b/ext/standard/tests/array/array_diff_assoc_variation4.phpt index 01b2e56a05..65b76dd9eb 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation4.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation4.phpt @@ -31,13 +31,6 @@ $inputs = array( 12345 => 'positive', -2345 => 'negative'), - // float data -/*2*/ -'float' => array( - 10.5 => 'float 1', - -10.5 => 'float 2', - .5 => 'float 3'), - // null data /*3*/ 'null' => array( @@ -109,22 +102,12 @@ array(4) { } -- Iteration 2 -- -array(3) { - [10]=> - string(7) "float 1" - [-10]=> - string(7) "float 2" - [0]=> - string(7) "float 3" -} - --- Iteration 3 -- array(1) { [""]=> string(6) "null 2" } --- Iteration 4 -- +-- Iteration 3 -- array(2) { [1]=> string(5) "boolT" @@ -132,13 +115,13 @@ array(2) { string(5) "boolF" } --- Iteration 5 -- +-- Iteration 4 -- array(1) { [""]=> string(6) "emptys" } --- Iteration 6 -- +-- Iteration 5 -- array(2) { ["string"]=> string(7) "strings" @@ -146,7 +129,7 @@ array(2) { string(7) "stringh" } --- Iteration 7 -- +-- Iteration 6 -- array(2) { ["binary1"]=> string(8) "binary 1" @@ -154,13 +137,13 @@ array(2) { string(8) "binary 2" } --- Iteration 8 -- +-- Iteration 7 -- array(1) { [""]=> string(9) "undefined" } --- Iteration 9 -- +-- Iteration 8 -- array(1) { [""]=> string(5) "unset" diff --git a/ext/standard/tests/array/array_diff_assoc_variation5.phpt b/ext/standard/tests/array/array_diff_assoc_variation5.phpt index df05e3db61..09af9cb4a5 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation5.phpt @@ -8,7 +8,7 @@ Test array_diff_assoc() function : usage variations - compare integers, floats a echo "*** Testing array_diff_assoc() : usage variations ***\n"; $arr_default_int = array(1, 2, 3, 'a'); -$arr_float = array(0 => 1.00, 1.00 => 2.00, 2.00 => 3.00, 'b'); +$arr_float = array(0 => 1.00, 1 => 2.00, 2 => 3.00, 'b'); $arr_string = array('1', '2', '3', 'c'); $arr_string_float = array('0' => '1.00', '1.00' => '2.00', '2.00' => '3.00', 'd'); diff --git a/ext/standard/tests/array/array_diff_key_variation5.phpt b/ext/standard/tests/array/array_diff_key_variation5.phpt deleted file mode 100644 index 2ba1da22b9..0000000000 --- a/ext/standard/tests/array/array_diff_key_variation5.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test array_diff_key() function : usage variation - Passing float indexed array ---FILE-- -<?php -echo "*** Testing array_diff_key() : usage variation ***\n"; - -// Initialise function arguments not being substituted (if any) -$input_array = array(0 => '0', 10 => '10', -10 => '-10', 20 =>'20', -20 => '-20'); -$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5', -10.5 => '-10.5', 0.5 => '0.5'); - -echo "\n-- Testing array_diff_key() function with float indexed array --\n"; -// loop through each element of the array for arr1 -var_dump( array_diff_key($input_array, $float_indx_array) ); -var_dump( array_diff_key($float_indx_array, $input_array) ); -?> ---EXPECT-- -*** Testing array_diff_key() : usage variation *** - --- Testing array_diff_key() function with float indexed array -- -array(2) { - [20]=> - string(2) "20" - [-20]=> - string(3) "-20" -} -array(0) { -} diff --git a/ext/standard/tests/array/array_diff_uassoc_variation10.phpt b/ext/standard/tests/array/array_diff_uassoc_variation10.phpt deleted file mode 100644 index 79e5a202c6..0000000000 --- a/ext/standard/tests/array/array_diff_uassoc_variation10.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test array_diff_uassoc() function : usage variation - Passing float indexed array ---FILE-- -<?php -echo "*** Testing array_diff_uassoc() : usage variation ***\n"; - -// Initialise function arguments not being substituted (if any) -$input_array = array(0 => '0', 10 => '10', -10 => '-10', 20 =>'20', -20 => '-20'); -$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5', -10.5 => '-10.5', 0.5 => '0.5'); - -echo "\n-- Testing array_diff_key() function with float indexed array --\n"; -var_dump( array_diff_uassoc($input_array, $float_indx_array, "strcasecmp") ); -var_dump( array_diff_uassoc($float_indx_array, $input_array, "strcasecmp") ); - -?> ---EXPECT-- -*** Testing array_diff_uassoc() : usage variation *** - --- Testing array_diff_key() function with float indexed array -- -array(5) { - [0]=> - string(1) "0" - [10]=> - string(2) "10" - [-10]=> - string(3) "-10" - [20]=> - string(2) "20" - [-20]=> - string(3) "-20" -} -array(3) { - [0]=> - string(3) "0.5" - [10]=> - string(4) "10.5" - [-10]=> - string(5) "-10.5" -} diff --git a/ext/standard/tests/array/array_diff_uassoc_variation5.phpt b/ext/standard/tests/array/array_diff_uassoc_variation5.phpt index d2500113de..ee7b96d4e3 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation5.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation5.phpt @@ -6,7 +6,7 @@ echo "*** Testing array_diff_uassoc() : usage variation ***\n"; //Initialize variables $arr_default_int = array(1, 2, 3, 4); -$arr_float = array(0 => 1.00, 1.00 => 2.00, 2.00 => 3.00, 3.00 => 4.00); +$arr_float = array(0 => 1.00, 1 => 2.00, 2 => 3.00, 3 => 4.00); function key_compare_func($key1, $key2) diff --git a/ext/standard/tests/array/array_diff_uassoc_variation6.phpt b/ext/standard/tests/array/array_diff_uassoc_variation6.phpt index 9e21fa0de3..177f7522e4 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation6.phpt @@ -5,7 +5,7 @@ Test array_diff_uassoc() function : usage variation - Comparing floating points echo "*** Testing array_diff_uassoc() : usage variation ***\n"; //Initialize variables -$arr_float = array(0 => 1.00, 1.00 => 2.00); +$arr_float = array(0 => 1.00, 1 => 2.00); $arr_string_int = array('1', '2'); $arr_string_float = array('0' => '1.00', '1.00' => '2.00'); diff --git a/ext/standard/tests/array/array_diff_ukey_variation7.phpt b/ext/standard/tests/array/array_diff_ukey_variation7.phpt deleted file mode 100644 index c534c2b36e..0000000000 --- a/ext/standard/tests/array/array_diff_ukey_variation7.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test array_diff_ukey() function : usage variation - Passing float indexed array ---FILE-- -<?php -echo "*** Testing array_diff_ukey() : usage variation ***\n"; - -// Initialise function arguments not being substituted (if any) -$input_array = array(0 => '0', 10 => '10', -10 => '-10', 20 =>'20'); -$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5', -30.5 => '-30.5'); - -function key_compare_func($key1, $key2) -{ - return strcasecmp($key1, $key2); -} - -echo "\n-- Testing array_diff_ukey() function with float indexed array --\n"; - -var_dump( array_diff_ukey($float_indx_array, $input_array, 'key_compare_func') ); -var_dump( array_diff_ukey($input_array, $float_indx_array, 'key_compare_func') ); - -?> ---EXPECT-- -*** Testing array_diff_ukey() : usage variation *** - --- Testing array_diff_ukey() function with float indexed array -- -array(1) { - [-30]=> - string(5) "-30.5" -} -array(2) { - [-10]=> - string(3) "-10" - [20]=> - string(2) "20" -} diff --git a/ext/standard/tests/array/array_diff_variation8.phpt b/ext/standard/tests/array/array_diff_variation8.phpt index 80d3bf87ec..5a1b2c4f30 100644 --- a/ext/standard/tests/array/array_diff_variation8.phpt +++ b/ext/standard/tests/array/array_diff_variation8.phpt @@ -41,8 +41,8 @@ $inputs = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 1.2), // arrays with string values -/*5*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "\tHello"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => '\tHello'), +/*5*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "\tHello"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => '\tHello'), array(1 => "hello", "heredoc" => $heredoc, $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_fill.phpt b/ext/standard/tests/array/array_fill.phpt index 4f2aa41b01..901b03b8b5 100644 --- a/ext/standard/tests/array/array_fill.phpt +++ b/ext/standard/tests/array/array_fill.phpt @@ -11,7 +11,7 @@ foreach($array1 as $start) foreach($array2 as $value) { echo '==========================='."\n"; - echo 'start: '.$start.' num: '.$num.' value: '.$value."\n"; + echo 'start: '.$start.' num: '.$num.' value: '. var_dump($value); $output = array_fill($start, $num, $value); var_dump($output); } @@ -20,324 +20,324 @@ foreach($array1 as $start) ?> --EXPECT-- =========================== -start: 0 num: 0 value: 1 -array(0) { +bool(true) +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 0 value: -array(0) { +bool(false) +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 0 value: -array(0) { +NULL +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 0 value: d -array(0) { +string(1) "d" +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 0 value: e -array(0) { +string(1) "e" +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 0 value: f -array(0) { +string(1) "f" +start: 0 num: 0 value: array(0) { } =========================== -start: 0 num: 1 value: 1 -array(1) { +bool(true) +start: 0 num: 1 value: array(1) { [0]=> bool(true) } =========================== -start: 0 num: 1 value: -array(1) { +bool(false) +start: 0 num: 1 value: array(1) { [0]=> bool(false) } =========================== -start: 0 num: 1 value: -array(1) { +NULL +start: 0 num: 1 value: array(1) { [0]=> NULL } =========================== -start: 0 num: 1 value: d -array(1) { +string(1) "d" +start: 0 num: 1 value: array(1) { [0]=> string(1) "d" } =========================== -start: 0 num: 1 value: e -array(1) { +string(1) "e" +start: 0 num: 1 value: array(1) { [0]=> string(1) "e" } =========================== -start: 0 num: 1 value: f -array(1) { +string(1) "f" +start: 0 num: 1 value: array(1) { [0]=> string(1) "f" } =========================== -start: 0 num: 2.5 value: 1 -array(2) { +bool(true) +start: 0 num: 2.5 value: array(2) { [0]=> bool(true) [1]=> bool(true) } =========================== -start: 0 num: 2.5 value: -array(2) { +bool(false) +start: 0 num: 2.5 value: array(2) { [0]=> bool(false) [1]=> bool(false) } =========================== -start: 0 num: 2.5 value: -array(2) { +NULL +start: 0 num: 2.5 value: array(2) { [0]=> NULL [1]=> NULL } =========================== -start: 0 num: 2.5 value: d -array(2) { +string(1) "d" +start: 0 num: 2.5 value: array(2) { [0]=> string(1) "d" [1]=> string(1) "d" } =========================== -start: 0 num: 2.5 value: e -array(2) { +string(1) "e" +start: 0 num: 2.5 value: array(2) { [0]=> string(1) "e" [1]=> string(1) "e" } =========================== -start: 0 num: 2.5 value: f -array(2) { +string(1) "f" +start: 0 num: 2.5 value: array(2) { [0]=> string(1) "f" [1]=> string(1) "f" } =========================== -start: 1 num: 0 value: 1 -array(0) { +bool(true) +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 0 value: -array(0) { +bool(false) +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 0 value: -array(0) { +NULL +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 0 value: d -array(0) { +string(1) "d" +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 0 value: e -array(0) { +string(1) "e" +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 0 value: f -array(0) { +string(1) "f" +start: 1 num: 0 value: array(0) { } =========================== -start: 1 num: 1 value: 1 -array(1) { +bool(true) +start: 1 num: 1 value: array(1) { [1]=> bool(true) } =========================== -start: 1 num: 1 value: -array(1) { +bool(false) +start: 1 num: 1 value: array(1) { [1]=> bool(false) } =========================== -start: 1 num: 1 value: -array(1) { +NULL +start: 1 num: 1 value: array(1) { [1]=> NULL } =========================== -start: 1 num: 1 value: d -array(1) { +string(1) "d" +start: 1 num: 1 value: array(1) { [1]=> string(1) "d" } =========================== -start: 1 num: 1 value: e -array(1) { +string(1) "e" +start: 1 num: 1 value: array(1) { [1]=> string(1) "e" } =========================== -start: 1 num: 1 value: f -array(1) { +string(1) "f" +start: 1 num: 1 value: array(1) { [1]=> string(1) "f" } =========================== -start: 1 num: 2.5 value: 1 -array(2) { +bool(true) +start: 1 num: 2.5 value: array(2) { [1]=> bool(true) [2]=> bool(true) } =========================== -start: 1 num: 2.5 value: -array(2) { +bool(false) +start: 1 num: 2.5 value: array(2) { [1]=> bool(false) [2]=> bool(false) } =========================== -start: 1 num: 2.5 value: -array(2) { +NULL +start: 1 num: 2.5 value: array(2) { [1]=> NULL [2]=> NULL } =========================== -start: 1 num: 2.5 value: d -array(2) { +string(1) "d" +start: 1 num: 2.5 value: array(2) { [1]=> string(1) "d" [2]=> string(1) "d" } =========================== -start: 1 num: 2.5 value: e -array(2) { +string(1) "e" +start: 1 num: 2.5 value: array(2) { [1]=> string(1) "e" [2]=> string(1) "e" } =========================== -start: 1 num: 2.5 value: f -array(2) { +string(1) "f" +start: 1 num: 2.5 value: array(2) { [1]=> string(1) "f" [2]=> string(1) "f" } =========================== -start: 2.5 num: 0 value: 1 -array(0) { +bool(true) +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 0 value: -array(0) { +bool(false) +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 0 value: -array(0) { +NULL +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 0 value: d -array(0) { +string(1) "d" +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 0 value: e -array(0) { +string(1) "e" +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 0 value: f -array(0) { +string(1) "f" +start: 2.5 num: 0 value: array(0) { } =========================== -start: 2.5 num: 1 value: 1 -array(1) { +bool(true) +start: 2.5 num: 1 value: array(1) { [2]=> bool(true) } =========================== -start: 2.5 num: 1 value: -array(1) { +bool(false) +start: 2.5 num: 1 value: array(1) { [2]=> bool(false) } =========================== -start: 2.5 num: 1 value: -array(1) { +NULL +start: 2.5 num: 1 value: array(1) { [2]=> NULL } =========================== -start: 2.5 num: 1 value: d -array(1) { +string(1) "d" +start: 2.5 num: 1 value: array(1) { [2]=> string(1) "d" } =========================== -start: 2.5 num: 1 value: e -array(1) { +string(1) "e" +start: 2.5 num: 1 value: array(1) { [2]=> string(1) "e" } =========================== -start: 2.5 num: 1 value: f -array(1) { +string(1) "f" +start: 2.5 num: 1 value: array(1) { [2]=> string(1) "f" } =========================== -start: 2.5 num: 2.5 value: 1 -array(2) { +bool(true) +start: 2.5 num: 2.5 value: array(2) { [2]=> bool(true) [3]=> bool(true) } =========================== -start: 2.5 num: 2.5 value: -array(2) { +bool(false) +start: 2.5 num: 2.5 value: array(2) { [2]=> bool(false) [3]=> bool(false) } =========================== -start: 2.5 num: 2.5 value: -array(2) { +NULL +start: 2.5 num: 2.5 value: array(2) { [2]=> NULL [3]=> NULL } =========================== -start: 2.5 num: 2.5 value: d -array(2) { +string(1) "d" +start: 2.5 num: 2.5 value: array(2) { [2]=> string(1) "d" [3]=> string(1) "d" } =========================== -start: 2.5 num: 2.5 value: e -array(2) { +string(1) "e" +start: 2.5 num: 2.5 value: array(2) { [2]=> string(1) "e" [3]=> string(1) "e" } =========================== -start: 2.5 num: 2.5 value: f -array(2) { +string(1) "f" +start: 2.5 num: 2.5 value: array(2) { [2]=> string(1) "f" [3]=> diff --git a/ext/standard/tests/array/array_filter_variation3.phpt b/ext/standard/tests/array/array_filter_variation3.phpt index 087267f566..a81bb35951 100644 --- a/ext/standard/tests/array/array_filter_variation3.phpt +++ b/ext/standard/tests/array/array_filter_variation3.phpt @@ -27,7 +27,7 @@ $input_values = array( array(true, false, TRUE, FALSE), // bool values array(null, NULL), // null values array(1 => 'one', 'zero' => 0, -2 => "value"), //associative array - array("one" => 1, null => 'null', 5.2 => "float", true => 1, "" => 'empty'), // associative array with different keys + array("one" => 1, null => 'null', 5 => "float", true => 1, "" => 'empty'), // associative array with different keys array(1 => 'one', 2, "key" => 'value') // combinition of associative and non-associative array ); diff --git a/ext/standard/tests/array/array_flip_variation5.phpt b/ext/standard/tests/array/array_flip_variation5.phpt index 49be7de903..e7c47dffa5 100644 --- a/ext/standard/tests/array/array_flip_variation5.phpt +++ b/ext/standard/tests/array/array_flip_variation5.phpt @@ -9,7 +9,7 @@ Test array_flip() function : usage variations - 'input' argument with repeatitiv echo "*** Testing array_flip() : 'input' array with repeatitive keys/values ***\n"; // array with numeric key repeatition -$input = array(1 => 'value', 2 => 'VALUE', 1 => "VaLuE", 3.4 => 4, 3.4 => 5); +$input = array(1 => 'value', 2 => 'VALUE', 1 => "VaLuE", 3 => 4, 3 => 5); var_dump( array_flip($input) ); // array with string key repeatition diff --git a/ext/standard/tests/array/array_intersect_assoc_variation5.phpt b/ext/standard/tests/array/array_intersect_assoc_variation5.phpt index 78b22b8ca6..ad0c29b6b5 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation5.phpt @@ -30,12 +30,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -100,33 +94,11 @@ array(0) { array(0) { } -- Iteration 5 -- -array(1) { - [2]=> - string(5) "float" -} -array(1) { - [2]=> - string(5) "float" -} --- Iteration 6 -- -array(2) { - [4]=> - string(2) "f3" - [33333333]=> - string(2) "f4" -} -array(2) { - [4]=> - string(2) "f3" - [33333333]=> - string(2) "f4" -} --- Iteration 7 -- array(0) { } array(0) { } --- Iteration 8 -- +-- Iteration 6 -- array(2) { [" Hello"]=> int(111) @@ -141,7 +113,7 @@ array(2) { "]=> int(33) } --- Iteration 9 -- +-- Iteration 7 -- array(1) { ["Hello world"]=> string(6) "string" @@ -150,12 +122,12 @@ array(1) { ["Hello world"]=> string(6) "string" } --- Iteration 10 -- +-- Iteration 8 -- array(0) { } array(0) { } --- Iteration 11 -- +-- Iteration 9 -- array(1) { [133]=> string(3) "int" diff --git a/ext/standard/tests/array/array_intersect_assoc_variation6.phpt b/ext/standard/tests/array/array_intersect_assoc_variation6.phpt index 396fe1fadc..57c3843d1f 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation6.phpt @@ -30,12 +30,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -100,33 +94,11 @@ array(0) { array(0) { } -- Iteration 5 -- -array(1) { - [2]=> - string(5) "float" -} -array(1) { - [2]=> - string(5) "float" -} --- Iteration 6 -- -array(2) { - [4]=> - string(2) "f3" - [33333333]=> - string(2) "f4" -} -array(2) { - [4]=> - string(2) "f3" - [33333333]=> - string(2) "f4" -} --- Iteration 7 -- array(0) { } array(0) { } --- Iteration 8 -- +-- Iteration 6 -- array(2) { [" Hello"]=> int(111) @@ -141,7 +113,7 @@ array(2) { "]=> int(33) } --- Iteration 9 -- +-- Iteration 7 -- array(1) { ["Hello world"]=> string(6) "string" @@ -150,12 +122,12 @@ array(1) { ["Hello world"]=> string(6) "string" } --- Iteration 10 -- +-- Iteration 8 -- array(0) { } array(0) { } --- Iteration 11 -- +-- Iteration 9 -- array(1) { [133]=> string(3) "int" diff --git a/ext/standard/tests/array/array_intersect_assoc_variation7.phpt b/ext/standard/tests/array/array_intersect_assoc_variation7.phpt index f512bf497d..f971b356ba 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation7.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation7.phpt @@ -46,8 +46,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable @@ -61,7 +61,7 @@ $arrays = array ( // array to be passsed to $arr2 argument $arr2 = array(0 => "0", 1, "two" => 2, "float" => 2.3333, "f1" => 1.2, - "f4" => 33333333.333, 111 => "\tHello", 3.3 => 'pen\n', '\v\fworld', + "f4" => 33333333.333, 111 => "\tHello", 3 => 'pen\n', '\v\fworld', "heredoc" => "Hello world", 11 => new classA(), "resource" => $fp, "int" => 133, 222 => "fruit"); diff --git a/ext/standard/tests/array/array_intersect_assoc_variation8.phpt b/ext/standard/tests/array/array_intersect_assoc_variation8.phpt index 8f46864c89..c4a26c09d5 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation8.phpt @@ -46,8 +46,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable @@ -61,7 +61,7 @@ $arrays = array ( // array to be passsed to $arr1 argument $arr1 = array(0 => "0", 1, "two" => 2, "float" => 2.3333, "f1" => 1.2, - "f4" => 33333333.333, 111 => "\tHello", 3.3 => 'pen\n', '\v\fworld', + "f4" => 33333333.333, 111 => "\tHello", 3 => 'pen\n', '\v\fworld', "heredoc" => "Hello world", 11 => new classA(), "resource" => $fp, "int" => 133, 222 => "fruit"); diff --git a/ext/standard/tests/array/array_intersect_key_variation5.phpt b/ext/standard/tests/array/array_intersect_key_variation5.phpt deleted file mode 100644 index 05788d7abb..0000000000 --- a/ext/standard/tests/array/array_intersect_key_variation5.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test array_intersect_key() function : usage variation - Passing float indexed array ---FILE-- -<?php -echo "*** Testing array_intersect_key() : usage variation ***\n"; - -// Initialise function arguments not being substituted (if any) -$input_array = array(0 => '0', 10 => '10' , -10 => '-10'); -$float_indx_array = array(0.0 => '0.0', 10.5 => '10.5' , -10.5 => '-10.5', 0.5 => '0.5'); - -echo "\n-- Testing array_intersect_key() function with float indexed array --\n"; -var_dump( array_intersect_key($input_array, $float_indx_array) ); -var_dump( array_intersect_key($float_indx_array,$input_array ) ); -?> ---EXPECT-- -*** Testing array_intersect_key() : usage variation *** - --- Testing array_intersect_key() function with float indexed array -- -array(3) { - [0]=> - string(1) "0" - [10]=> - string(2) "10" - [-10]=> - string(3) "-10" -} -array(3) { - [0]=> - string(3) "0.5" - [10]=> - string(4) "10.5" - [-10]=> - string(5) "-10.5" -} diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation5.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation5.phpt index e936f8a883..c46aaa3162 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation5.phpt @@ -6,7 +6,7 @@ echo "*** Testing array_intersect_uassoc() : usage variation ***\n"; //Initialize variables $arr_default_int = array(1, 2 ); -$arr_float = array(0 => 1.00, 1.00 => 2.00, 2.00 => 3.00); +$arr_float = array(0 => 1.00, 1 => 2.00, 2 => 3.00); $arr_string = array('1', '2', '3'); $arr_string_float = array('1.00', '2.00'); diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation6.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation6.phpt index 7a6a2ea714..e286c8e9e7 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation6.phpt @@ -5,7 +5,7 @@ Test array_intersect_uassoc() function : usage variation - Intersection of float echo "*** Testing array_intersect_uassoc() : usage variation ***\n"; //Initialize variables -$arr_float = array(0 => 1.00, 1.00 => 2.00); +$arr_float = array(0 => 1.00, 1 => 2.00); $arr_string = array('1', '2', '3'); $arr_string_float = array('1.00', '2.00'); diff --git a/ext/standard/tests/array/array_intersect_ukey_variation5.phpt b/ext/standard/tests/array/array_intersect_ukey_variation5.phpt index 1839e7b4ba..f3fd8abd5c 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation5.phpt @@ -6,7 +6,7 @@ echo "*** Testing array_intersect_ukey() : usage variation ***\n"; //Initialize variables $arr_default_int = array(1, 2 ); -$arr_float = array(0 => 1.00, 1.00 => 2.00, 2.00 => 3.00); +$arr_float = array(0 => 1.00, 1 => 2.00, 2 => 3.00); $arr_string = array('0' => '1', '1' => '2', '2' => '3'); $arr_string_float = array('0.00' => '1.00', '1.00' => '2.00'); diff --git a/ext/standard/tests/array/array_intersect_ukey_variation6.phpt b/ext/standard/tests/array/array_intersect_ukey_variation6.phpt index abdf7e96ad..e843da4277 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation6.phpt @@ -5,7 +5,7 @@ Test array_intersect_ukey() function : usage variation - Intersection of floatin echo "*** Testing array_intersect_ukey() : usage variation ***\n"; //Initialize variables -$arr_float = array(0.00 => 1.00, 1.00 => 2.00); +$arr_float = array(0 => 1.00, 1 => 2.00); $arr_string = array('0' => '1', '1' => '2', '2' => '3'); $arr_string_float = array('0.00' => '1.00', '1.00' => '2.00'); diff --git a/ext/standard/tests/array/array_intersect_variation5.phpt b/ext/standard/tests/array/array_intersect_variation5.phpt index 67efa2bf75..04eb9b43c3 100644 --- a/ext/standard/tests/array/array_intersect_variation5.phpt +++ b/ext/standard/tests/array/array_intersect_variation5.phpt @@ -30,12 +30,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -102,24 +96,6 @@ array(1) { string(1) "1" } -- Iterator 5 -- -array(1) { - [2]=> - string(5) "float" -} -array(1) { - [2]=> - string(5) "float" -} --- Iterator 6 -- -array(1) { - [33333333]=> - string(2) "f4" -} -array(1) { - [33333333]=> - string(2) "f4" -} --- Iterator 7 -- array(2) { ["re\td"]=> string(5) "color" @@ -132,7 +108,7 @@ array(2) { ["\v\fworld"]=> float(2.2) } --- Iterator 8 -- +-- Iterator 6 -- array(2) { ["re d"]=> string(5) "color" @@ -145,7 +121,7 @@ array(2) { ["world"]=> float(2.2) } --- Iterator 9 -- +-- Iterator 7 -- array(2) { [0]=> string(5) "hello" @@ -158,7 +134,7 @@ array(2) { ["Hello world"]=> string(6) "string" } --- Iterator 10 -- +-- Iterator 8 -- array(1) { [""]=> string(5) "hello" @@ -167,7 +143,7 @@ array(1) { [""]=> string(5) "hello" } --- Iterator 11 -- +-- Iterator 9 -- array(3) { ["hello"]=> int(1) diff --git a/ext/standard/tests/array/array_intersect_variation6.phpt b/ext/standard/tests/array/array_intersect_variation6.phpt index 0dea24b7cb..b35a6ce076 100644 --- a/ext/standard/tests/array/array_intersect_variation6.phpt +++ b/ext/standard/tests/array/array_intersect_variation6.phpt @@ -30,12 +30,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -102,24 +96,6 @@ array(1) { int(1) } -- Iterator 5 -- -array(1) { - [1]=> - string(5) "float" -} -array(1) { - [1]=> - string(5) "float" -} --- Iterator 6 -- -array(1) { - [2]=> - string(2) "f4" -} -array(1) { - [2]=> - string(2) "f4" -} --- Iterator 7 -- array(2) { [4]=> float(2.2) @@ -132,7 +108,7 @@ array(2) { [5]=> string(5) "color" } --- Iterator 8 -- +-- Iterator 6 -- array(2) { [4]=> float(2.2) @@ -145,7 +121,7 @@ array(2) { [5]=> string(5) "color" } --- Iterator 9 -- +-- Iterator 7 -- array(2) { [3]=> string(5) "hello" @@ -158,7 +134,7 @@ array(2) { [6]=> string(6) "string" } --- Iterator 10 -- +-- Iterator 8 -- array(1) { [3]=> string(5) "hello" @@ -167,7 +143,7 @@ array(1) { [3]=> string(5) "hello" } --- Iterator 11 -- +-- Iterator 9 -- array(3) { [0]=> int(1) diff --git a/ext/standard/tests/array/array_intersect_variation7.phpt b/ext/standard/tests/array/array_intersect_variation7.phpt index 5e3b19aac8..559783b96c 100644 --- a/ext/standard/tests/array/array_intersect_variation7.phpt +++ b/ext/standard/tests/array/array_intersect_variation7.phpt @@ -46,8 +46,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_intersect_variation8.phpt b/ext/standard/tests/array/array_intersect_variation8.phpt index bdd98d92a9..319804bbc7 100644 --- a/ext/standard/tests/array/array_intersect_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_variation8.phpt @@ -46,8 +46,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index 3e0e5ffaaa..d6f9ca13de 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -12,7 +12,6 @@ $search_arrays = array( array("Name" => "Jack", "Loc" => "Mars", "Id" => "MS123"), array('Red' => 'Rose', 'I' => 'You'), array(0 => 'Zero', 1 => 'One', 2 => 'Two', 3 => "Three" ), - array(0.1 => 'Zero', 1.1 => 'One', 2.2 => 'Two', 3.3 => "Three" ) ); /* keys to search in $search_arrays. $keys[0] is the key to be searched in $search_arrays[0] and so on */ @@ -99,8 +98,6 @@ bool(true) bool(true) -- Iteration 7 -- bool(true) --- Iteration 8 -- -bool(true) *** Testing possible variations *** @@ -161,14 +158,6 @@ bool(false) bool(false) bool(false) bool(true) --- Iteration 8 -- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) ** Variation loop 2 ** -- Iteration 1 -- diff --git a/ext/standard/tests/array/array_key_exists_variation1.phpt b/ext/standard/tests/array/array_key_exists_variation1.phpt index eef48998fb..3a410258bb 100644 --- a/ext/standard/tests/array/array_key_exists_variation1.phpt +++ b/ext/standard/tests/array/array_key_exists_variation1.phpt @@ -40,13 +40,6 @@ $inputs = array( 12345, -2345, - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - // null data /*10*/ NULL, null, @@ -112,13 +105,13 @@ bool(false) bool(false) -- Iteration 5 -- -bool(true) +bool(false) -- Iteration 6 -- bool(false) -- Iteration 7 -- -bool(false) +bool(true) -- Iteration 8 -- bool(true) @@ -127,16 +120,16 @@ bool(true) bool(true) -- Iteration 10 -- -bool(false) +bool(true) -- Iteration 11 -- bool(false) -- Iteration 12 -- -bool(true) +bool(false) -- Iteration 13 -- -bool(true) +Illegal offset type -- Iteration 14 -- bool(true) @@ -145,33 +138,18 @@ bool(true) bool(true) -- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -Illegal offset type - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- bool(true) --- Iteration 22 -- +-- Iteration 17 -- Illegal offset type --- Iteration 23 -- +-- Iteration 18 -- bool(false) --- Iteration 24 -- +-- Iteration 19 -- bool(false) --- Iteration 25 -- +-- Iteration 20 -- Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d bool(false) diff --git a/ext/standard/tests/array/array_key_exists_variation8.phpt b/ext/standard/tests/array/array_key_exists_variation8.phpt index 8aa4c74896..417b56aae8 100644 --- a/ext/standard/tests/array/array_key_exists_variation8.phpt +++ b/ext/standard/tests/array/array_key_exists_variation8.phpt @@ -30,18 +30,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - - 'extreme floats' => array( - 12.3456789000e10 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*3*/ 'null uppercase' => array( NULL => 'null 1', @@ -112,13 +100,6 @@ bool(true) bool(true) bool(true) bool(true) --- $key arguments are float data: -bool(false) -bool(false) -bool(true) --- $key arguments are extreme floats data: -bool(false) -bool(true) -- $key arguments are null uppercase data: bool(false) -- $key arguments are null lowercase data: @@ -142,91 +123,12 @@ bool(false) -- $key arguments are unset data: bool(false) --- Iteration 2: float data -- --- $key arguments are int data: -bool(true) -bool(false) -bool(false) -bool(false) --- $key arguments are float data: -bool(true) -bool(true) -bool(true) --- $key arguments are extreme floats data: -bool(false) -bool(true) --- $key arguments are null uppercase data: -bool(false) --- $key arguments are null lowercase data: -bool(false) --- $key arguments are bool lowercase data: -bool(false) -bool(true) --- $key arguments are bool uppercase data: -bool(false) -bool(true) --- $key arguments are empty double quotes data: -bool(false) --- $key arguments are empty single quotes data: -bool(false) --- $key arguments are string data: -bool(false) -bool(false) -bool(false) --- $key arguments are undefined data: -bool(false) --- $key arguments are unset data: -bool(false) - --- Iteration 3: extreme floats data -- --- $key arguments are int data: -bool(true) -bool(false) -bool(false) -bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(true) --- $key arguments are extreme floats data: -bool(true) -bool(true) --- $key arguments are null uppercase data: -bool(false) --- $key arguments are null lowercase data: -bool(false) --- $key arguments are bool lowercase data: -bool(false) -bool(true) --- $key arguments are bool uppercase data: -bool(false) -bool(true) --- $key arguments are empty double quotes data: -bool(false) --- $key arguments are empty single quotes data: -bool(false) --- $key arguments are string data: -bool(false) -bool(false) -bool(false) --- $key arguments are undefined data: -bool(false) --- $key arguments are unset data: -bool(false) - --- Iteration 4: null uppercase data -- +-- Iteration 2: null uppercase data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: @@ -250,19 +152,12 @@ bool(true) -- $key arguments are unset data: bool(true) --- Iteration 5: null lowercase data -- +-- Iteration 3: null lowercase data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: @@ -286,19 +181,12 @@ bool(true) -- $key arguments are unset data: bool(true) --- Iteration 6: bool lowercase data -- +-- Iteration 4: bool lowercase data -- -- $key arguments are int data: bool(true) bool(true) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(true) --- $key arguments are extreme floats data: -bool(false) -bool(true) -- $key arguments are null uppercase data: bool(false) -- $key arguments are null lowercase data: @@ -322,19 +210,12 @@ bool(false) -- $key arguments are unset data: bool(false) --- Iteration 7: bool uppercase data -- +-- Iteration 5: bool uppercase data -- -- $key arguments are int data: bool(true) bool(true) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(true) --- $key arguments are extreme floats data: -bool(false) -bool(true) -- $key arguments are null uppercase data: bool(false) -- $key arguments are null lowercase data: @@ -358,19 +239,12 @@ bool(false) -- $key arguments are unset data: bool(false) --- Iteration 8: empty double quotes data -- +-- Iteration 6: empty double quotes data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: @@ -394,19 +268,12 @@ bool(true) -- $key arguments are unset data: bool(true) --- Iteration 9: empty single quotes data -- +-- Iteration 7: empty single quotes data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: @@ -430,19 +297,12 @@ bool(true) -- $key arguments are unset data: bool(true) --- Iteration 10: string data -- +-- Iteration 8: string data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(false) -- $key arguments are null lowercase data: @@ -466,19 +326,12 @@ bool(false) -- $key arguments are unset data: bool(false) --- Iteration 11: undefined data -- +-- Iteration 9: undefined data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: @@ -502,19 +355,12 @@ bool(true) -- $key arguments are unset data: bool(true) --- Iteration 12: unset data -- +-- Iteration 10: unset data -- -- $key arguments are int data: bool(false) bool(false) bool(false) bool(false) --- $key arguments are float data: -bool(false) -bool(false) -bool(false) --- $key arguments are extreme floats data: -bool(false) -bool(false) -- $key arguments are null uppercase data: bool(true) -- $key arguments are null lowercase data: diff --git a/ext/standard/tests/array/array_key_first.phpt b/ext/standard/tests/array/array_key_first.phpt index 6235386004..d3360f6bfe 100644 --- a/ext/standard/tests/array/array_key_first.phpt +++ b/ext/standard/tests/array/array_key_first.phpt @@ -14,12 +14,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ), + 5 => 57, "5.4" => 554, "5.7" => 557 ), array( "foo" ), array( 1 => "42" ) ); @@ -31,7 +31,7 @@ $counter = 1; foreach( $mixed_array as $sub_array ) { echo "\n-- Input Array for Iteration $counter is --\n"; - print_r( $sub_array ); + var_dump( $sub_array ); echo "\nFirst key is :\n"; var_dump( array_key_first($sub_array) ); $counter++; @@ -43,190 +43,247 @@ echo"\nDone"; *** Normal testing with various array inputs *** -- Input Array for Iteration 1 is -- -Array -( -) +array(0) { +} First key is : NULL -- Input Array for Iteration 2 is -- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [3] => 4 - [4] => 5 - [5] => 6 - [6] => 7 - [7] => 8 - [8] => 9 -) +array(9) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) +} First key is : int(0) -- Input Array for Iteration 3 is -- -Array -( - [0] => One - [1] => _Two - [2] => Three - [3] => Four - [4] => Five -) +array(5) { + [0]=> + string(3) "One" + [1]=> + string(4) "_Two" + [2]=> + string(5) "Three" + [3]=> + string(4) "Four" + [4]=> + string(4) "Five" +} First key is : int(0) -- Input Array for Iteration 4 is -- -Array -( - [0] => 6 - [1] => six - [2] => 7 - [3] => seven - [4] => 8 - [5] => eight - [6] => 9 - [7] => nine -) +array(8) { + [0]=> + int(6) + [1]=> + string(3) "six" + [2]=> + int(7) + [3]=> + string(5) "seven" + [4]=> + int(8) + [5]=> + string(5) "eight" + [6]=> + int(9) + [7]=> + string(4) "nine" +} First key is : int(0) -- Input Array for Iteration 5 is -- -Array -( - [a] => aaa - [A] => AAA - [c] => ccc - [d] => ddd - [e] => eee -) +array(5) { + ["a"]=> + string(3) "aaa" + ["A"]=> + string(3) "AAA" + ["c"]=> + string(3) "ccc" + ["d"]=> + string(3) "ddd" + ["e"]=> + string(3) "eee" +} First key is : string(1) "a" -- Input Array for Iteration 6 is -- -Array -( - [1] => one - [2] => two - [3] => three - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} First key is : int(1) -- Input Array for Iteration 7 is -- -Array -( - [1] => one - [2] => two - [3] => 7 - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + int(7) + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} First key is : int(1) -- Input Array for Iteration 8 is -- -Array -( - [f] => fff - [1] => one - [4] => 6 - [] => 3 - [2] => float - [F] => FFF - [blank] => - [3] => 3.7 - [5] => Five - [6] => 8.6 - [4name] => jonny - [a] => -) +array(12) { + ["f"]=> + string(3) "fff" + [1]=> + string(3) "one" + [4]=> + int(6) + [""]=> + int(3) + [2]=> + string(5) "float" + ["F"]=> + string(3) "FFF" + ["blank"]=> + string(0) "" + [3]=> + float(3.7) + [5]=> + string(4) "Five" + [6]=> + float(8.6) + ["4name"]=> + string(5) "jonny" + ["a"]=> + NULL +} First key is : string(1) "f" -- Input Array for Iteration 9 is -- -Array -( - [0] => 12 - [1] => name - [2] => age - [3] => 45 -) +array(4) { + [0]=> + int(12) + [1]=> + string(4) "name" + [2]=> + string(3) "age" + [3]=> + string(2) "45" +} First key is : int(0) -- Input Array for Iteration 10 is -- -Array -( - [0] => Array - ( - [0] => oNe - [1] => tWo - [2] => 4 - ) - - [1] => Array - ( - [0] => 10 - [1] => 20 - [2] => 30 - [3] => 40 - [4] => 50 - ) - - [2] => Array - ( - ) - -) +array(3) { + [0]=> + array(3) { + [0]=> + string(3) "oNe" + [1]=> + string(3) "tWo" + [2]=> + int(4) + } + [1]=> + array(5) { + [0]=> + int(10) + [1]=> + int(20) + [2]=> + int(30) + [3]=> + int(40) + [4]=> + int(50) + } + [2]=> + array(0) { + } +} First key is : int(0) -- Input Array for Iteration 11 is -- -Array -( - [one] => 2 - [three] => 3 - [0] => 3 - [1] => 4 - [3] => 33 - [4] => 44 - [5] => 57 - [6] => 6 - [5.4] => 554 - [5.7] => 557 -) +array(10) { + ["one"]=> + int(2) + ["three"]=> + int(3) + [0]=> + int(3) + [1]=> + int(4) + [3]=> + int(33) + [4]=> + int(44) + [5]=> + int(57) + [6]=> + int(6) + ["5.4"]=> + int(554) + ["5.7"]=> + int(557) +} First key is : string(3) "one" -- Input Array for Iteration 12 is -- -Array -( - [0] => foo -) +array(1) { + [0]=> + string(3) "foo" +} First key is : int(0) -- Input Array for Iteration 13 is -- -Array -( - [1] => 42 -) +array(1) { + [1]=> + string(2) "42" +} First key is : int(1) diff --git a/ext/standard/tests/array/array_key_last.phpt b/ext/standard/tests/array/array_key_last.phpt index 599d80eac4..c325be6560 100644 --- a/ext/standard/tests/array/array_key_last.phpt +++ b/ext/standard/tests/array/array_key_last.phpt @@ -14,12 +14,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ), + 5 => 57, "5.4" => 554, "5.7" => 557 ), array( "foo" ), array( 1 => "42" ) ); @@ -31,7 +31,7 @@ $counter = 1; foreach( $mixed_array as $sub_array ) { echo "\n-- Input Array for Iteration $counter is --\n"; - print_r( $sub_array ); + var_dump( $sub_array ); echo "\nLast key is :\n"; var_dump( array_key_last($sub_array) ); $counter++; @@ -43,190 +43,247 @@ echo"\nDone"; *** Normal testing with various array inputs *** -- Input Array for Iteration 1 is -- -Array -( -) +array(0) { +} Last key is : NULL -- Input Array for Iteration 2 is -- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [3] => 4 - [4] => 5 - [5] => 6 - [6] => 7 - [7] => 8 - [8] => 9 -) +array(9) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) +} Last key is : int(8) -- Input Array for Iteration 3 is -- -Array -( - [0] => One - [1] => _Two - [2] => Three - [3] => Four - [4] => Five -) +array(5) { + [0]=> + string(3) "One" + [1]=> + string(4) "_Two" + [2]=> + string(5) "Three" + [3]=> + string(4) "Four" + [4]=> + string(4) "Five" +} Last key is : int(4) -- Input Array for Iteration 4 is -- -Array -( - [0] => 6 - [1] => six - [2] => 7 - [3] => seven - [4] => 8 - [5] => eight - [6] => 9 - [7] => nine -) +array(8) { + [0]=> + int(6) + [1]=> + string(3) "six" + [2]=> + int(7) + [3]=> + string(5) "seven" + [4]=> + int(8) + [5]=> + string(5) "eight" + [6]=> + int(9) + [7]=> + string(4) "nine" +} Last key is : int(7) -- Input Array for Iteration 5 is -- -Array -( - [a] => aaa - [A] => AAA - [c] => ccc - [d] => ddd - [e] => eee -) +array(5) { + ["a"]=> + string(3) "aaa" + ["A"]=> + string(3) "AAA" + ["c"]=> + string(3) "ccc" + ["d"]=> + string(3) "ddd" + ["e"]=> + string(3) "eee" +} Last key is : string(1) "e" -- Input Array for Iteration 6 is -- -Array -( - [1] => one - [2] => two - [3] => three - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Last key is : int(5) -- Input Array for Iteration 7 is -- -Array -( - [1] => one - [2] => two - [3] => 7 - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + int(7) + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Last key is : int(5) -- Input Array for Iteration 8 is -- -Array -( - [f] => fff - [1] => one - [4] => 6 - [] => 3 - [2] => float - [F] => FFF - [blank] => - [3] => 3.7 - [5] => Five - [6] => 8.6 - [4name] => jonny - [a] => -) +array(12) { + ["f"]=> + string(3) "fff" + [1]=> + string(3) "one" + [4]=> + int(6) + [""]=> + int(3) + [2]=> + string(5) "float" + ["F"]=> + string(3) "FFF" + ["blank"]=> + string(0) "" + [3]=> + float(3.7) + [5]=> + string(4) "Five" + [6]=> + float(8.6) + ["4name"]=> + string(5) "jonny" + ["a"]=> + NULL +} Last key is : string(1) "a" -- Input Array for Iteration 9 is -- -Array -( - [0] => 12 - [1] => name - [2] => age - [3] => 45 -) +array(4) { + [0]=> + int(12) + [1]=> + string(4) "name" + [2]=> + string(3) "age" + [3]=> + string(2) "45" +} Last key is : int(3) -- Input Array for Iteration 10 is -- -Array -( - [0] => Array - ( - [0] => oNe - [1] => tWo - [2] => 4 - ) - - [1] => Array - ( - [0] => 10 - [1] => 20 - [2] => 30 - [3] => 40 - [4] => 50 - ) - - [2] => Array - ( - ) - -) +array(3) { + [0]=> + array(3) { + [0]=> + string(3) "oNe" + [1]=> + string(3) "tWo" + [2]=> + int(4) + } + [1]=> + array(5) { + [0]=> + int(10) + [1]=> + int(20) + [2]=> + int(30) + [3]=> + int(40) + [4]=> + int(50) + } + [2]=> + array(0) { + } +} Last key is : int(2) -- Input Array for Iteration 11 is -- -Array -( - [one] => 2 - [three] => 3 - [0] => 3 - [1] => 4 - [3] => 33 - [4] => 44 - [5] => 57 - [6] => 6 - [5.4] => 554 - [5.7] => 557 -) +array(10) { + ["one"]=> + int(2) + ["three"]=> + int(3) + [0]=> + int(3) + [1]=> + int(4) + [3]=> + int(33) + [4]=> + int(44) + [5]=> + int(57) + [6]=> + int(6) + ["5.4"]=> + int(554) + ["5.7"]=> + int(557) +} Last key is : string(3) "5.7" -- Input Array for Iteration 12 is -- -Array -( - [0] => foo -) +array(1) { + [0]=> + string(3) "foo" +} Last key is : int(0) -- Input Array for Iteration 13 is -- -Array -( - [1] => 42 -) +array(1) { + [1]=> + string(2) "42" +} Last key is : int(1) diff --git a/ext/standard/tests/array/array_keys_basic.phpt b/ext/standard/tests/array/array_keys_basic.phpt index 0aa84d984d..dc54976d1d 100644 --- a/ext/standard/tests/array/array_keys_basic.phpt +++ b/ext/standard/tests/array/array_keys_basic.phpt @@ -4,7 +4,7 @@ Test array_keys() function (basic) <?php echo "*** Testing array_keys() on basic array operation ***\n"; -$basic_arr = array("a" => 1, "b" => 2, 2.0 => 2.0, -23.45 => "asdasd", +$basic_arr = array("a" => 1, "b" => 2, 2 => 2.0, -23 => "asdasd", array(1,2,3)); var_dump(array_keys($basic_arr)); diff --git a/ext/standard/tests/array/array_keys_variation_001.phpt b/ext/standard/tests/array/array_keys_variation_001.phpt index e9944ed112..fdba88afbd 100644 --- a/ext/standard/tests/array/array_keys_variation_001.phpt +++ b/ext/standard/tests/array/array_keys_variation_001.phpt @@ -13,7 +13,7 @@ $arrays = array( array(1,2,3, "d" => array(4,6, "d")), array("a" => 1, "b" => 2, "c" =>3, "d" => array()), array(0 => 0, 1 => 1, 2 => 2, 3 => 3), - array(0.001=>3.000, 1.002=>2, 1.999=>3, "a"=>3, 3=>5, "5"=>3.000), + array(0 =>3.000, 1 =>2, 1 =>3, "a"=>3, 3=>5, "5"=>3.000), array(TRUE => TRUE, FALSE => FALSE, NULL => NULL, "\x000", "\000"), array("a" => "abcd", "a" => "", "ab" => -6, "cd" => -0.5 ), array(0 => array(), 1=> array(0), 2 => array(1), ""=> array(),""=>"" ) diff --git a/ext/standard/tests/array/array_map_variation4.phpt b/ext/standard/tests/array/array_map_variation4.phpt index dadfbaafa1..ea495cbcd8 100644 --- a/ext/standard/tests/array/array_map_variation4.phpt +++ b/ext/standard/tests/array/array_map_variation4.phpt @@ -43,10 +43,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", 4.89999922839999 => "f3", 33333333.333333 => "f4"), - // arrays with string keys array('\tHello' => 111, 're\td' => 'color', '\v\fworld' => 2.2, 'pen\n' => 33), /*8*/ array("\tHello" => 111, "re\td" => "color", "\v\fworld" => 2.2, "pen\n" => 33), @@ -102,22 +98,6 @@ array(4) { string(1) "4" } -- Iteration 5 -- -array(1) { - [2]=> - string(5) "float" -} --- Iteration 6 -- -array(4) { - [1]=> - string(2) "f1" - [3]=> - string(2) "f2" - [4]=> - string(2) "f3" - [33333333]=> - string(2) "f4" -} --- Iteration 7 -- array(4) { ["\tHello"]=> int(111) @@ -128,7 +108,7 @@ array(4) { ["pen\n"]=> int(33) } --- Iteration 8 -- +-- Iteration 6 -- array(4) { [" Hello"]=> int(111) @@ -140,21 +120,21 @@ array(4) { "]=> int(33) } --- Iteration 9 -- +-- Iteration 7 -- array(2) { [0]=> string(5) "hello" ["Hello world"]=> string(6) "string" } --- Iteration 10 -- +-- Iteration 8 -- array(2) { [""]=> string(5) "hello" [5]=> string(8) "resource" } --- Iteration 11 -- +-- Iteration 9 -- array(7) { ["hello"]=> int(1) diff --git a/ext/standard/tests/array/array_map_variation5.phpt b/ext/standard/tests/array/array_map_variation5.phpt index 9b6a896fa9..c7ff35d9b2 100644 --- a/ext/standard/tests/array/array_map_variation5.phpt +++ b/ext/standard/tests/array/array_map_variation5.phpt @@ -48,8 +48,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.3333), // arrays with string values - array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), -/*8*/ array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), + array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), +/*8*/ array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_merge.phpt b/ext/standard/tests/array/array_merge.phpt index b78da3082a..eced097818 100644 --- a/ext/standard/tests/array/array_merge.phpt +++ b/ext/standard/tests/array/array_merge.phpt @@ -9,10 +9,10 @@ $begin_array = array( array(), array( 1 => "string"), array( "" => "string"), - array( -2.44444 => 12), + array( -2 => 12), array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344), array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL,1 => -2.344), - array( NULL, 1.23 => "Hi", "string" => "hello", + array( NULL, 1 => "Hi", "string" => "hello", array("" => "World", "-2.34" => "a", "0" => "b")) ); @@ -20,10 +20,10 @@ $end_array = array( array(), array( 1 => "string"), array( "" => "string"), - array( -2.44444 => 12), + array( -2 => 12), array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344), array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL, 1=> -2.344), - array( NULL, 1.23 => "Hi", "string" => "hello", + array( NULL, 1 => "Hi", "string" => "hello", array("" => "World", "-2.34" => "a", "0" => "b")) ); @@ -35,7 +35,7 @@ foreach($begin_array as $first) { foreach($end_array as $second) { echo "\n-- Inner iteration $count_inner of Iteration $count_outer --\n"; $result = array_merge($first, $second); - print_r($result); + var_dump($result); $count_inner++; } $count_outer++; @@ -84,549 +84,718 @@ echo "Done\n"; --- Iteration 0 --- -- Inner iteration 0 of Iteration 0 -- -Array -( -) +array(0) { +} -- Inner iteration 1 of Iteration 0 -- -Array -( - [0] => string -) +array(1) { + [0]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 0 -- -Array -( - [] => string -) +array(1) { + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 0 -- -Array -( - [0] => 12 -) +array(1) { + [0]=> + int(12) +} -- Inner iteration 4 of Iteration 0 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(4) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 0 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 -) +array(4) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 0 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(4) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 1 --- -- Inner iteration 0 of Iteration 1 -- -Array -( - [0] => string -) +array(1) { + [0]=> + string(6) "string" +} -- Inner iteration 1 of Iteration 1 -- -Array -( - [0] => string - [1] => string -) +array(2) { + [0]=> + string(6) "string" + [1]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 1 -- -Array -( - [0] => string - [] => string -) +array(2) { + [0]=> + string(6) "string" + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 1 -- -Array -( - [0] => string - [1] => 12 -) +array(2) { + [0]=> + string(6) "string" + [1]=> + int(12) +} -- Inner iteration 4 of Iteration 1 -- -Array -( - [0] => string - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(5) { + [0]=> + string(6) "string" + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 1 -- -Array -( - [0] => string - [1] => 1 - [2] => string - [3] => - [4] => -2.344 -) +array(5) { + [0]=> + string(6) "string" + [1]=> + int(1) + [2]=> + string(6) "string" + [3]=> + NULL + [4]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 1 -- -Array -( - [0] => string - [1] => - [2] => Hi - [string] => hello - [3] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(5) { + [0]=> + string(6) "string" + [1]=> + NULL + [2]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [3]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 2 --- -- Inner iteration 0 of Iteration 2 -- -Array -( - [] => string -) +array(1) { + [""]=> + string(6) "string" +} -- Inner iteration 1 of Iteration 2 -- -Array -( - [] => string - [0] => string -) +array(2) { + [""]=> + string(6) "string" + [0]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 2 -- -Array -( - [] => string -) +array(1) { + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 2 -- -Array -( - [] => string - [0] => 12 -) +array(2) { + [""]=> + string(6) "string" + [0]=> + int(12) +} -- Inner iteration 4 of Iteration 2 -- -Array -( - [] => string - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(5) { + [""]=> + string(6) "string" + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 2 -- -Array -( - [] => string - [0] => 1 - [1] => string - [2] => - [3] => -2.344 -) +array(5) { + [""]=> + string(6) "string" + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 2 -- -Array -( - [] => string - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(5) { + [""]=> + string(6) "string" + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 3 --- -- Inner iteration 0 of Iteration 3 -- -Array -( - [0] => 12 -) +array(1) { + [0]=> + int(12) +} -- Inner iteration 1 of Iteration 3 -- -Array -( - [0] => 12 - [1] => string -) +array(2) { + [0]=> + int(12) + [1]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 3 -- -Array -( - [0] => 12 - [] => string -) +array(2) { + [0]=> + int(12) + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 3 -- -Array -( - [0] => 12 - [1] => 12 -) +array(2) { + [0]=> + int(12) + [1]=> + int(12) +} -- Inner iteration 4 of Iteration 3 -- -Array -( - [0] => 12 - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(5) { + [0]=> + int(12) + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 3 -- -Array -( - [0] => 12 - [1] => 1 - [2] => string - [3] => - [4] => -2.344 -) +array(5) { + [0]=> + int(12) + [1]=> + int(1) + [2]=> + string(6) "string" + [3]=> + NULL + [4]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 3 -- -Array -( - [0] => 12 - [1] => - [2] => Hi - [string] => hello - [3] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(5) { + [0]=> + int(12) + [1]=> + NULL + [2]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [3]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 4 --- -- Inner iteration 0 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(4) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 1 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 - [0] => string -) +array(5) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) + [0]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 - [] => string -) +array(5) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 - [0] => 12 -) +array(5) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) + [0]=> + int(12) +} -- Inner iteration 4 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(4) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 - [0] => 1 - [1] => string - [2] => - [3] => -2.344 -) +array(8) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 4 -- -Array -( - [a] => 1 - [b] => string - [c] => - [d] => -2.344 - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(8) { + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 5 --- -- Inner iteration 0 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 -) +array(4) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) +} -- Inner iteration 1 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [4] => string -) +array(5) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + [4]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [] => string -) +array(5) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [4] => 12 -) +array(5) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + [4]=> + int(12) +} -- Inner iteration 4 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(8) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [4] => 1 - [5] => string - [6] => - [7] => -2.344 -) +array(8) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + [4]=> + int(1) + [5]=> + string(6) "string" + [6]=> + NULL + [7]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 5 -- -Array -( - [0] => 1 - [1] => string - [2] => - [3] => -2.344 - [4] => - [5] => Hi - [string] => hello - [6] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(8) { + [0]=> + int(1) + [1]=> + string(6) "string" + [2]=> + NULL + [3]=> + float(-2.344) + [4]=> + NULL + [5]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [6]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} --- Iteration 6 --- -- Inner iteration 0 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(4) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} -- Inner iteration 1 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [3] => string -) +array(5) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + [3]=> + string(6) "string" +} -- Inner iteration 2 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [] => string -) +array(5) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + [""]=> + string(6) "string" +} -- Inner iteration 3 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [3] => 12 -) +array(5) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + [3]=> + int(12) +} -- Inner iteration 4 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [a] => 1 - [b] => string - [c] => - [d] => -2.344 -) +array(8) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + ["a"]=> + int(1) + ["b"]=> + string(6) "string" + ["c"]=> + NULL + ["d"]=> + float(-2.344) +} -- Inner iteration 5 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [3] => 1 - [4] => string - [5] => - [6] => -2.344 -) +array(8) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + [3]=> + int(1) + [4]=> + string(6) "string" + [5]=> + NULL + [6]=> + float(-2.344) +} -- Inner iteration 6 of Iteration 6 -- -Array -( - [0] => - [1] => Hi - [string] => hello - [2] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - - [3] => - [4] => Hi - [5] => Array - ( - [] => World - [-2.34] => a - [0] => b - ) - -) +array(7) { + [0]=> + NULL + [1]=> + string(2) "Hi" + ["string"]=> + string(5) "hello" + [2]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } + [3]=> + NULL + [4]=> + string(2) "Hi" + [5]=> + array(3) { + [""]=> + string(5) "World" + ["-2.34"]=> + string(1) "a" + [0]=> + string(1) "b" + } +} *** Testing array_merge() with three or more arrays *** array(12) { diff --git a/ext/standard/tests/array/array_merge_recursive_variation4.phpt b/ext/standard/tests/array/array_merge_recursive_variation4.phpt index 6208adabed..71f4a4d66f 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation4.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation4.phpt @@ -35,10 +35,6 @@ $arrays = array ( array(0 => "0", 1 => array(1 => "one")), array(1 => "1", 2 => array(1 => "one", 2 => "two", 3 => 1, 4 => "4")), - // arrays with float keys -/*3*/ array(2.3333 => "float", 44.44 => array(1.1 => "float")), - array(1.2 => "f1", 3.33 => "f2", 4.89999922839999 => array(1.1 => "f1"), 3333333.333333 => "f4"), - // arrays with string keys /*5*/ array('\tHello' => array("hello", 'world'), '\v\fworld' => 2.2, 'pen\n' => 111), array("\tHello" => array("hello", 'world'), "\v\fworld" => 2.2, "pen\n" => 111), @@ -162,86 +158,6 @@ array(6) { } -- Iteration 3 -- -- With default argument -- -array(2) { - [0]=> - string(5) "float" - [1]=> - array(1) { - [1]=> - string(5) "float" - } -} --- With more arguments -- -array(6) { - [0]=> - string(5) "float" - [1]=> - array(1) { - [1]=> - string(5) "float" - } - [2]=> - string(3) "one" - [3]=> - int(2) - ["string"]=> - string(5) "hello" - ["array"]=> - array(3) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" - } -} --- Iteration 4 -- --- With default argument -- -array(4) { - [0]=> - string(2) "f1" - [1]=> - string(2) "f2" - [2]=> - array(1) { - [1]=> - string(2) "f1" - } - [3]=> - string(2) "f4" -} --- With more arguments -- -array(8) { - [0]=> - string(2) "f1" - [1]=> - string(2) "f2" - [2]=> - array(1) { - [1]=> - string(2) "f1" - } - [3]=> - string(2) "f4" - [4]=> - string(3) "one" - [5]=> - int(2) - ["string"]=> - string(5) "hello" - ["array"]=> - array(3) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" - } -} --- Iteration 5 -- --- With default argument -- array(3) { ["\tHello"]=> array(2) { @@ -284,7 +200,7 @@ array(7) { string(1) "c" } } --- Iteration 6 -- +-- Iteration 4 -- -- With default argument -- array(3) { [" Hello"]=> @@ -330,7 +246,7 @@ array(7) { string(1) "c" } } --- Iteration 7 -- +-- Iteration 5 -- -- With default argument -- array(3) { [0]=> @@ -374,7 +290,7 @@ array(7) { string(1) "c" } } --- Iteration 8 -- +-- Iteration 6 -- -- With default argument -- array(4) { [""]=> diff --git a/ext/standard/tests/array/array_merge_recursive_variation5.phpt b/ext/standard/tests/array/array_merge_recursive_variation5.phpt index 701817730c..617811b5f6 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation5.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation5.phpt @@ -40,8 +40,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => array(1.2, 'f4' => 1.2)), // arrays with string values -/*5*/ array(111 => "\tHello", "array" => "col\tor", 2 => "\v\fworld", 3.3 => "\tHello"), - array(111 => '\tHello', 'array' => 'col\tor', 2 => '\v\fworld', 3.3 => '\tHello'), +/*5*/ array(111 => "\tHello", "array" => "col\tor", 2 => "\v\fworld", 3 => "\tHello"), + array(111 => '\tHello', 'array' => 'col\tor', 2 => '\v\fworld', 3 => '\tHello'), array(1 => "hello", "string" => $heredoc, $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_merge_variation4.phpt b/ext/standard/tests/array/array_merge_variation4.phpt index 456d80a2c7..e34bf73526 100644 --- a/ext/standard/tests/array/array_merge_variation4.phpt +++ b/ext/standard/tests/array/array_merge_variation4.phpt @@ -32,18 +32,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e10 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -135,55 +123,7 @@ array(6) { string(8) "negative" } --- Iteration 2: float data -- -array(5) { - [0]=> - string(8) "positive" - [1]=> - string(8) "negative" - [2]=> - string(4) "half" - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(5) { - ["one"]=> - int(1) - ["two"]=> - int(2) - [0]=> - string(8) "positive" - [1]=> - string(8) "negative" - [2]=> - string(4) "half" -} - --- Iteration 3: extreme floats data -- -array(4) { - [0]=> - string(5) "large" - [1]=> - string(5) "small" - ["one"]=> - int(1) - ["two"]=> - int(2) -} -array(4) { - ["one"]=> - int(1) - ["two"]=> - int(2) - [0]=> - string(5) "large" - [1]=> - string(5) "small" -} - --- Iteration 4: null uppercase data -- +-- Iteration 2: null uppercase data -- array(3) { [""]=> string(6) "null 1" @@ -201,7 +141,7 @@ array(3) { string(6) "null 1" } --- Iteration 5: null lowercase data -- +-- Iteration 3: null lowercase data -- array(3) { [""]=> string(6) "null 2" @@ -219,7 +159,7 @@ array(3) { string(6) "null 2" } --- Iteration 6: bool lowercase data -- +-- Iteration 4: bool lowercase data -- array(4) { [0]=> string(6) "lowert" @@ -241,7 +181,7 @@ array(4) { string(6) "lowerf" } --- Iteration 7: bool uppercase data -- +-- Iteration 5: bool uppercase data -- array(4) { [0]=> string(6) "uppert" @@ -263,7 +203,7 @@ array(4) { string(6) "upperf" } --- Iteration 8: empty double quotes data -- +-- Iteration 6: empty double quotes data -- array(3) { [""]=> string(6) "emptyd" @@ -281,7 +221,7 @@ array(3) { string(6) "emptyd" } --- Iteration 9: empty single quotes data -- +-- Iteration 7: empty single quotes data -- array(3) { [""]=> string(6) "emptys" @@ -299,7 +239,7 @@ array(3) { string(6) "emptys" } --- Iteration 10: string data -- +-- Iteration 8: string data -- array(5) { ["stringd"]=> string(7) "stringd" @@ -325,7 +265,7 @@ array(5) { string(7) "stringh" } --- Iteration 11: undefined data -- +-- Iteration 9: undefined data -- array(3) { [""]=> string(9) "undefined" @@ -343,7 +283,7 @@ array(3) { string(9) "undefined" } --- Iteration 12: unset data -- +-- Iteration 10: unset data -- array(3) { [""]=> string(5) "unset" diff --git a/ext/standard/tests/array/array_merge_variation7.phpt b/ext/standard/tests/array/array_merge_variation7.phpt index 60642fc43e..a196effc75 100644 --- a/ext/standard/tests/array/array_merge_variation7.phpt +++ b/ext/standard/tests/array/array_merge_variation7.phpt @@ -11,7 +11,7 @@ echo "*** Testing array_merge() : usage variations ***\n"; //mixed keys $arr1 = array('zero', 20 => 'twenty', 'thirty' => 30, true => 'bool'); -$arr2 = array(0, 1, 2, null => 'null', 1.234E-10 => 'float'); +$arr2 = array(0, 1, 2, null => 'null', 0 => 'float'); var_dump(array_merge($arr1, $arr2)); var_dump(array_merge($arr2, $arr1)); diff --git a/ext/standard/tests/array/array_pop.phpt b/ext/standard/tests/array/array_pop.phpt index 45df24d311..2066f1acb6 100644 --- a/ext/standard/tests/array/array_pop.phpt +++ b/ext/standard/tests/array/array_pop.phpt @@ -17,12 +17,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ) + 5 => 57, "5.4" => 554, "5.7" => 557 ) ); /* Loop to test normal functionality with different arrays inputs */ @@ -32,7 +32,7 @@ $counter = 1; foreach( $mixed_array as $sub_array ) { echo "\n-- Input Array for Iteration $counter is --\n"; - print_r( $sub_array ); + var_dump( $sub_array ); echo "\nOutput after Pop is :\n"; var_dump( array_pop($sub_array) ); $counter++; @@ -44,173 +44,230 @@ echo"\nDone"; *** Normal testing with various array inputs *** -- Input Array for Iteration 1 is -- -Array -( -) +array(0) { +} Output after Pop is : NULL -- Input Array for Iteration 2 is -- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [3] => 4 - [4] => 5 - [5] => 6 - [6] => 7 - [7] => 8 - [8] => 9 -) +array(9) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) +} Output after Pop is : int(9) -- Input Array for Iteration 3 is -- -Array -( - [0] => One - [1] => _Two - [2] => Three - [3] => Four - [4] => Five -) +array(5) { + [0]=> + string(3) "One" + [1]=> + string(4) "_Two" + [2]=> + string(5) "Three" + [3]=> + string(4) "Four" + [4]=> + string(4) "Five" +} Output after Pop is : string(4) "Five" -- Input Array for Iteration 4 is -- -Array -( - [0] => 6 - [1] => six - [2] => 7 - [3] => seven - [4] => 8 - [5] => eight - [6] => 9 - [7] => nine -) +array(8) { + [0]=> + int(6) + [1]=> + string(3) "six" + [2]=> + int(7) + [3]=> + string(5) "seven" + [4]=> + int(8) + [5]=> + string(5) "eight" + [6]=> + int(9) + [7]=> + string(4) "nine" +} Output after Pop is : string(4) "nine" -- Input Array for Iteration 5 is -- -Array -( - [a] => aaa - [A] => AAA - [c] => ccc - [d] => ddd - [e] => eee -) +array(5) { + ["a"]=> + string(3) "aaa" + ["A"]=> + string(3) "AAA" + ["c"]=> + string(3) "ccc" + ["d"]=> + string(3) "ddd" + ["e"]=> + string(3) "eee" +} Output after Pop is : string(3) "eee" -- Input Array for Iteration 6 is -- -Array -( - [1] => one - [2] => two - [3] => three - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after Pop is : string(4) "five" -- Input Array for Iteration 7 is -- -Array -( - [1] => one - [2] => two - [3] => 7 - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + int(7) + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after Pop is : string(4) "five" -- Input Array for Iteration 8 is -- -Array -( - [f] => fff - [1] => one - [4] => 6 - [] => 3 - [2] => float - [F] => FFF - [blank] => - [3] => 3.7 - [5] => Five - [6] => 8.6 - [4name] => jonny - [a] => -) +array(12) { + ["f"]=> + string(3) "fff" + [1]=> + string(3) "one" + [4]=> + int(6) + [""]=> + int(3) + [2]=> + string(5) "float" + ["F"]=> + string(3) "FFF" + ["blank"]=> + string(0) "" + [3]=> + float(3.7) + [5]=> + string(4) "Five" + [6]=> + float(8.6) + ["4name"]=> + string(5) "jonny" + ["a"]=> + NULL +} Output after Pop is : NULL -- Input Array for Iteration 9 is -- -Array -( - [0] => 12 - [1] => name - [2] => age - [3] => 45 -) +array(4) { + [0]=> + int(12) + [1]=> + string(4) "name" + [2]=> + string(3) "age" + [3]=> + string(2) "45" +} Output after Pop is : string(2) "45" -- Input Array for Iteration 10 is -- -Array -( - [0] => Array - ( - [0] => oNe - [1] => tWo - [2] => 4 - ) - - [1] => Array - ( - [0] => 10 - [1] => 20 - [2] => 30 - [3] => 40 - [4] => 50 - ) - - [2] => Array - ( - ) - -) +array(3) { + [0]=> + array(3) { + [0]=> + string(3) "oNe" + [1]=> + string(3) "tWo" + [2]=> + int(4) + } + [1]=> + array(5) { + [0]=> + int(10) + [1]=> + int(20) + [2]=> + int(30) + [3]=> + int(40) + [4]=> + int(50) + } + [2]=> + array(0) { + } +} Output after Pop is : array(0) { } -- Input Array for Iteration 11 is -- -Array -( - [one] => 2 - [three] => 3 - [0] => 3 - [1] => 4 - [3] => 33 - [4] => 44 - [5] => 57 - [6] => 6 - [5.4] => 554 - [5.7] => 557 -) +array(10) { + ["one"]=> + int(2) + ["three"]=> + int(3) + [0]=> + int(3) + [1]=> + int(4) + [3]=> + int(33) + [4]=> + int(44) + [5]=> + int(57) + [6]=> + int(6) + ["5.4"]=> + int(554) + ["5.7"]=> + int(557) +} Output after Pop is : int(557) diff --git a/ext/standard/tests/array/array_pop_variation.phpt b/ext/standard/tests/array/array_pop_variation.phpt index c2e30cb7a3..af8b0cc0f9 100644 --- a/ext/standard/tests/array/array_pop_variation.phpt +++ b/ext/standard/tests/array/array_pop_variation.phpt @@ -12,12 +12,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ) + 5 => 57, "5.4" => 554, "5.7" => 557 ) ); echo"\n*** Checking for internal array pointer being reset when pop is called ***\n"; diff --git a/ext/standard/tests/array/array_push.phpt b/ext/standard/tests/array/array_push.phpt index 67a2f2019b..1c560adc51 100644 --- a/ext/standard/tests/array/array_push.phpt +++ b/ext/standard/tests/array/array_push.phpt @@ -17,12 +17,12 @@ $mixed_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ), array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ), array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ) + 5 => 57, "5.4" => 554, "5.7" => 557 ) ); /* Error Conditions */ @@ -42,7 +42,7 @@ $counter = 1; foreach( $mixed_array as $sub_array ) { echo "\n-- Input Array for Iteration $counter is --\n"; - print_r( $sub_array ); + var_dump( $sub_array ); echo "\nOutput after push is :\n"; var_dump( array_push($sub_array, 22, "abc") ); $counter++; @@ -63,174 +63,233 @@ int(1) *** Testing with various array inputs *** -- Input Array for Iteration 1 is -- -Array -( -) +array(0) { +} Output after push is : int(2) -- Input Array for Iteration 2 is -- -Array -( - [0] => 1 - [1] => 2 - [2] => 3 - [3] => 4 - [4] => 5 - [5] => 6 - [6] => 7 - [7] => 8 - [8] => 9 - [9] => 1 - [10] => 2 -) +array(11) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) + [9]=> + int(1) + [10]=> + int(2) +} Output after push is : int(13) -- Input Array for Iteration 3 is -- -Array -( - [0] => One - [1] => _Two - [2] => Three - [3] => Four - [4] => Five -) +array(5) { + [0]=> + string(3) "One" + [1]=> + string(4) "_Two" + [2]=> + string(5) "Three" + [3]=> + string(4) "Four" + [4]=> + string(4) "Five" +} Output after push is : int(7) -- Input Array for Iteration 4 is -- -Array -( - [0] => 6 - [1] => six - [2] => 7 - [3] => seven - [4] => 8 - [5] => eight - [6] => 9 - [7] => nine -) +array(8) { + [0]=> + int(6) + [1]=> + string(3) "six" + [2]=> + int(7) + [3]=> + string(5) "seven" + [4]=> + int(8) + [5]=> + string(5) "eight" + [6]=> + int(9) + [7]=> + string(4) "nine" +} Output after push is : int(10) -- Input Array for Iteration 5 is -- -Array -( - [a] => aaa - [A] => AAA - [c] => ccc - [d] => ddd - [e] => eee -) +array(5) { + ["a"]=> + string(3) "aaa" + ["A"]=> + string(3) "AAA" + ["c"]=> + string(3) "ccc" + ["d"]=> + string(3) "ddd" + ["e"]=> + string(3) "eee" +} Output after push is : int(7) -- Input Array for Iteration 6 is -- -Array -( - [1] => one - [2] => two - [3] => three - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after push is : int(7) -- Input Array for Iteration 7 is -- -Array -( - [1] => one - [2] => two - [3] => 7 - [4] => four - [5] => five -) +array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + int(7) + [4]=> + string(4) "four" + [5]=> + string(4) "five" +} Output after push is : int(7) -- Input Array for Iteration 8 is -- -Array -( - [f] => fff - [1] => one - [4] => 6 - [] => 3 - [2] => float - [F] => FFF - [blank] => - [3] => 3.7 - [5] => Five - [6] => 8.6 - [4name] => jonny - [a] => -) +array(12) { + ["f"]=> + string(3) "fff" + [1]=> + string(3) "one" + [4]=> + int(6) + [""]=> + int(3) + [2]=> + string(5) "float" + ["F"]=> + string(3) "FFF" + ["blank"]=> + string(0) "" + [3]=> + float(3.7) + [5]=> + string(4) "Five" + [6]=> + float(8.6) + ["4name"]=> + string(5) "jonny" + ["a"]=> + NULL +} Output after push is : int(14) -- Input Array for Iteration 9 is -- -Array -( - [0] => 12 - [1] => name - [2] => age - [3] => 45 -) +array(4) { + [0]=> + int(12) + [1]=> + string(4) "name" + [2]=> + string(3) "age" + [3]=> + string(2) "45" +} Output after push is : int(6) -- Input Array for Iteration 10 is -- -Array -( - [0] => Array - ( - [0] => oNe - [1] => tWo - [2] => 4 - ) - - [1] => Array - ( - [0] => 10 - [1] => 20 - [2] => 30 - [3] => 40 - [4] => 50 - ) - - [2] => Array - ( - ) - -) +array(3) { + [0]=> + array(3) { + [0]=> + string(3) "oNe" + [1]=> + string(3) "tWo" + [2]=> + int(4) + } + [1]=> + array(5) { + [0]=> + int(10) + [1]=> + int(20) + [2]=> + int(30) + [3]=> + int(40) + [4]=> + int(50) + } + [2]=> + array(0) { + } +} Output after push is : int(5) -- Input Array for Iteration 11 is -- -Array -( - [one] => 2 - [three] => 3 - [0] => 3 - [1] => 4 - [3] => 33 - [4] => 44 - [5] => 57 - [6] => 6 - [5.4] => 554 - [5.7] => 557 -) +array(10) { + ["one"]=> + int(2) + ["three"]=> + int(3) + [0]=> + int(3) + [1]=> + int(4) + [3]=> + int(33) + [4]=> + int(44) + [5]=> + int(57) + [6]=> + int(6) + ["5.4"]=> + int(554) + ["5.7"]=> + int(557) +} Output after push is : int(12) diff --git a/ext/standard/tests/array/array_push_variation6.phpt b/ext/standard/tests/array/array_push_variation6.phpt index b8cce79821..610e4efaa0 100644 --- a/ext/standard/tests/array/array_push_variation6.phpt +++ b/ext/standard/tests/array/array_push_variation6.phpt @@ -31,18 +31,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - - 'extreme floats' => array( - 12.3456789000e10 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*3*/ 'null uppercase' => array( NULL => 'null 1', @@ -107,47 +95,39 @@ echo "Done"; Before : int(4) After : int(5) --- Iteration 2 : float data -- -Before : int(3) -After : int(4) - --- Iteration 3 : extreme floats data -- -Before : int(2) -After : int(3) - --- Iteration 4 : null uppercase data -- +-- Iteration 2 : null uppercase data -- Before : int(1) After : int(2) --- Iteration 5 : null lowercase data -- +-- Iteration 3 : null lowercase data -- Before : int(1) After : int(2) --- Iteration 6 : bool lowercase data -- +-- Iteration 4 : bool lowercase data -- Before : int(2) After : int(3) --- Iteration 7 : bool uppercase data -- +-- Iteration 5 : bool uppercase data -- Before : int(2) After : int(3) --- Iteration 8 : empty double quotes data -- +-- Iteration 6 : empty double quotes data -- Before : int(1) After : int(2) --- Iteration 9 : empty single quotes data -- +-- Iteration 7 : empty single quotes data -- Before : int(1) After : int(2) --- Iteration 10 : string data -- +-- Iteration 8 : string data -- Before : int(3) After : int(4) --- Iteration 11 : undefined data -- +-- Iteration 9 : undefined data -- Before : int(1) After : int(2) --- Iteration 12 : unset data -- +-- Iteration 10 : unset data -- Before : int(1) After : int(2) Done diff --git a/ext/standard/tests/array/array_rand_variation4.phpt b/ext/standard/tests/array/array_rand_variation4.phpt index 1ddcec1933..a714244766 100644 --- a/ext/standard/tests/array/array_rand_variation4.phpt +++ b/ext/standard/tests/array/array_rand_variation4.phpt @@ -14,8 +14,7 @@ $asso_arrays = array( // array with numeric keys /*1*/ array(1 => 'one', 2 => 2, 1234567890 => 'big', -1 => 'negative key', - 2.3 => 'float key', 0 => "zero key", 0.2 => 'decimal key', - 2e2 => 'exp key1', -2e3 => 'negative exp key'), + 0 => "zero key"), // array with string keys array('one' => 1, "two" => 2.0, "three" => 'three', diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt index 4a4295c615..57f5ee03af 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -12,8 +12,7 @@ echo "*** Testing array_rand() : with invalid values for 'req_num' ***\n"; // initialise associative arrays $input = array( - 1 => 'one', 2.2 => 'float key', 0.9 => 'decimal key', - 2e2 => 'exp key1', 2000e-3 => 'negative exp key', + 1 => 'one', 0xabc => 2748, 0x12f => '303', 0xff => "255", 0123 => 83, 012 => 10, 010 => "8" ); diff --git a/ext/standard/tests/array/array_reverse_variation4.phpt b/ext/standard/tests/array/array_reverse_variation4.phpt index 861b5972a4..9a4fcbffbb 100644 --- a/ext/standard/tests/array/array_reverse_variation4.phpt +++ b/ext/standard/tests/array/array_reverse_variation4.phpt @@ -39,10 +39,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", 4.89999922839999 => "f3", 33333333.333333 => "f4"), - // arrays with string keys array("\tHello" => 111, "re\td" => "color", "\v\fworld" => 2.2, "pen\n" => 33), /*8*/ array("\tHello" => 111, "re\td" => "color", "\v\fworld" => 2.2, "pen\n" => 33), @@ -159,56 +155,6 @@ array(4) { } -- Iteration 5 -- - default argument - -array(1) { - [0]=> - string(5) "float" -} -- $preserve keys = true - -array(1) { - [2]=> - string(5) "float" -} -- $preserve_keys = false - -array(1) { - [0]=> - string(5) "float" -} --- Iteration 6 -- -- default argument - -array(4) { - [0]=> - string(2) "f4" - [1]=> - string(2) "f3" - [2]=> - string(2) "f2" - [3]=> - string(2) "f1" -} -- $preserve keys = true - -array(4) { - [33333333]=> - string(2) "f4" - [4]=> - string(2) "f3" - [3]=> - string(2) "f2" - [1]=> - string(2) "f1" -} -- $preserve_keys = false - -array(4) { - [0]=> - string(2) "f4" - [1]=> - string(2) "f3" - [2]=> - string(2) "f2" - [3]=> - string(2) "f1" -} --- Iteration 7 -- -- default argument - array(4) { ["pen "]=> @@ -244,7 +190,7 @@ array(4) { [" Hello"]=> int(111) } --- Iteration 8 -- +-- Iteration 6 -- - default argument - array(4) { ["pen @@ -281,7 +227,7 @@ array(4) { [" Hello"]=> int(111) } --- Iteration 9 -- +-- Iteration 7 -- - default argument - array(2) { ["Hello world"]=> @@ -303,7 +249,7 @@ array(2) { [0]=> string(5) "hello" } --- Iteration 10 -- +-- Iteration 8 -- - default argument - array(2) { [0]=> @@ -325,7 +271,7 @@ array(2) { [""]=> string(5) "hello" } --- Iteration 11 -- +-- Iteration 9 -- - default argument - array(7) { ["Hello world"]=> diff --git a/ext/standard/tests/array/array_reverse_variation5.phpt b/ext/standard/tests/array/array_reverse_variation5.phpt index d5651e4551..dcefab26a3 100644 --- a/ext/standard/tests/array/array_reverse_variation5.phpt +++ b/ext/standard/tests/array/array_reverse_variation5.phpt @@ -47,8 +47,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333333), // arrays with string values - array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), -/*8*/ array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), + array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), +/*8*/ array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_search_variation1.phpt b/ext/standard/tests/array/array_search_variation1.phpt index d62501f418..a2838810a1 100644 --- a/ext/standard/tests/array/array_search_variation1.phpt +++ b/ext/standard/tests/array/array_search_variation1.phpt @@ -9,7 +9,7 @@ $arrays = array ( array(0), array("a" => "A", 2 => "B", "C" => 3, 4 => 4, "one" => 1, "" => NULL, "b", "ab", "abcd"), array(4, array(1, 2 => 3), "one" => 1, "5" => 5 ), - array(-1, -2, -3, -4, -2.989888, "-0.005" => "neg0.005", 2.0 => "float2", "-.9" => -.9), + array(-1, -2, -3, -4, -2.989888, "-0.005" => "neg0.005", 2 => "float2", "-.9" => -.9), array(TRUE, FALSE), array("", array()), array("abcd\x00abcd\x00abcd"), diff --git a/ext/standard/tests/array/array_search_variation2.phpt b/ext/standard/tests/array/array_search_variation2.phpt index 84928c5922..c391989f32 100644 --- a/ext/standard/tests/array/array_search_variation2.phpt +++ b/ext/standard/tests/array/array_search_variation2.phpt @@ -12,7 +12,7 @@ $misc_array = array ( 3, ".001" =>-67, "-.051" =>"k", - 0.091 =>"-.08", + 0 =>"-.08", "e" =>"5", "y" =>NULL, NULL =>"", diff --git a/ext/standard/tests/array/array_shift_variation3.phpt b/ext/standard/tests/array/array_shift_variation3.phpt index bc06b41d01..e43bc86858 100644 --- a/ext/standard/tests/array/array_shift_variation3.phpt +++ b/ext/standard/tests/array/array_shift_variation3.phpt @@ -28,18 +28,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e10 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -112,57 +100,41 @@ array(3) { string(8) "negative" } --- Iteration 2 : float data -- -string(8) "positive" -array(2) { - [0]=> - string(8) "negative" - [1]=> - string(4) "half" -} - --- Iteration 3 : extreme floats data -- -string(5) "large" -array(1) { - [0]=> - string(5) "small" -} - --- Iteration 4 : null uppercase data -- +-- Iteration 2 : null uppercase data -- string(6) "null 1" array(0) { } --- Iteration 5 : null lowercase data -- +-- Iteration 3 : null lowercase data -- string(6) "null 2" array(0) { } --- Iteration 6 : bool lowercase data -- +-- Iteration 4 : bool lowercase data -- string(6) "lowert" array(1) { [0]=> string(6) "lowerf" } --- Iteration 7 : bool uppercase data -- +-- Iteration 5 : bool uppercase data -- string(6) "uppert" array(1) { [0]=> string(6) "upperf" } --- Iteration 8 : empty double quotes data -- +-- Iteration 6 : empty double quotes data -- string(6) "emptyd" array(0) { } --- Iteration 9 : empty single quotes data -- +-- Iteration 7 : empty single quotes data -- string(6) "emptys" array(0) { } --- Iteration 10 : string data -- +-- Iteration 8 : string data -- string(7) "stringd" array(2) { ["strings"]=> @@ -171,12 +143,12 @@ array(2) { string(7) "stringh" } --- Iteration 11 : undefined data -- +-- Iteration 9 : undefined data -- string(9) "undefined" array(0) { } --- Iteration 12 : unset data -- +-- Iteration 10 : unset data -- string(5) "unset" array(0) { } diff --git a/ext/standard/tests/array/array_slice.phpt b/ext/standard/tests/array/array_slice.phpt index a76277883a..f12f6d62fa 100644 --- a/ext/standard/tests/array/array_slice.phpt +++ b/ext/standard/tests/array/array_slice.phpt @@ -11,8 +11,8 @@ $var_array = array( array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee"), array("1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five"), array(1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five"), - array("f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five"), + array("f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five"), array(12, "name", 'age', '45'), array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array()) ); diff --git a/ext/standard/tests/array/array_slice_variation7.phpt b/ext/standard/tests/array/array_slice_variation7.phpt index a579f292ef..d0db376ad5 100644 --- a/ext/standard/tests/array/array_slice_variation7.phpt +++ b/ext/standard/tests/array/array_slice_variation7.phpt @@ -33,18 +33,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e6 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -132,43 +120,7 @@ array(4) { string(8) "negative" } --- Iteration 2 : key type is float -- -$preserve_keys = TRUE -array(3) { - [10]=> - string(8) "positive" - [-10]=> - string(8) "negative" - [0]=> - string(4) "half" -} -$preserve_keys = FALSE -array(3) { - [0]=> - string(8) "positive" - [1]=> - string(8) "negative" - [2]=> - string(4) "half" -} - --- Iteration 3 : key type is extreme floats -- -$preserve_keys = TRUE -array(2) { - [12345678]=> - string(5) "large" - [0]=> - string(5) "small" -} -$preserve_keys = FALSE -array(2) { - [0]=> - string(5) "large" - [1]=> - string(5) "small" -} - --- Iteration 4 : key type is null uppercase -- +-- Iteration 2 : key type is null uppercase -- $preserve_keys = TRUE array(1) { [""]=> @@ -180,7 +132,7 @@ array(1) { string(6) "null 1" } --- Iteration 5 : key type is null lowercase -- +-- Iteration 3 : key type is null lowercase -- $preserve_keys = TRUE array(1) { [""]=> @@ -192,7 +144,7 @@ array(1) { string(6) "null 2" } --- Iteration 6 : key type is bool lowercase -- +-- Iteration 4 : key type is bool lowercase -- $preserve_keys = TRUE array(2) { [1]=> @@ -208,7 +160,7 @@ array(2) { string(6) "lowerf" } --- Iteration 7 : key type is bool uppercase -- +-- Iteration 5 : key type is bool uppercase -- $preserve_keys = TRUE array(2) { [1]=> @@ -224,7 +176,7 @@ array(2) { string(6) "upperf" } --- Iteration 8 : key type is empty double quotes -- +-- Iteration 6 : key type is empty double quotes -- $preserve_keys = TRUE array(1) { [""]=> @@ -236,7 +188,7 @@ array(1) { string(6) "emptyd" } --- Iteration 9 : key type is empty single quotes -- +-- Iteration 7 : key type is empty single quotes -- $preserve_keys = TRUE array(1) { [""]=> @@ -248,7 +200,7 @@ array(1) { string(6) "emptys" } --- Iteration 10 : key type is string -- +-- Iteration 8 : key type is string -- $preserve_keys = TRUE array(3) { ["stringd"]=> @@ -268,7 +220,7 @@ array(3) { string(7) "stringh" } --- Iteration 11 : key type is undefined -- +-- Iteration 9 : key type is undefined -- $preserve_keys = TRUE array(1) { [""]=> @@ -280,7 +232,7 @@ array(1) { string(9) "undefined" } --- Iteration 12 : key type is unset -- +-- Iteration 10 : key type is unset -- $preserve_keys = TRUE array(1) { [""]=> diff --git a/ext/standard/tests/array/array_udiff_assoc_variation.phpt b/ext/standard/tests/array/array_udiff_assoc_variation.phpt index 83af4bce95..9250f5957b 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation.phpt @@ -8,7 +8,7 @@ include('compare_function.inc'); $key_compare_function = 'compare_function'; // Initialise all required variables -$arr1 = array("one" => "one", "02" => "two", '3' => "three", "four", "0.5" => 5, 6.0 => 6, "seven" => "07"); +$arr1 = array("one" => "one", "02" => "two", '3' => "three", "four", "0.5" => 5, 6 => 6, "seven" => "07"); $arr2 = array("one" => "one", "02" => "two", '3' => "three"); $arr3 = array("four", "0.5" => "five", 6 => 6, "seven" => 7); $arr4 = array("four", "0.5" => "five", 6 => 6, "seven" => 7); diff --git a/ext/standard/tests/array/array_uintersect_assoc_basic2.phpt b/ext/standard/tests/array/array_uintersect_assoc_basic2.phpt index bd8163c82d..57a735b864 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_basic2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_basic2.phpt @@ -8,7 +8,7 @@ include('compare_function.inc'); $data_compare_function = 'compare_function'; // Initialise all required variables -$arr1 = array("one" => "one", "02" => "two", '3' => "three", "four", "0.5" => 5, 0.6 => 6, "0x7" => "seven"); +$arr1 = array("one" => "one", "02" => "two", '3' => "three", "four", "0.5" => 5, 0 => 6, "0x7" => "seven"); $arr2 = array("one" => "one", "02" => "two", '3' => "three"); $arr3 = array("one" => "one", '3' => "three", "0.5" => 5); $arr4 = array("one" => "one", '3' => "three", "0.5" => 5); diff --git a/ext/standard/tests/array/array_unique_variation3.phpt b/ext/standard/tests/array/array_unique_variation3.phpt index fb38929909..b412a19a42 100644 --- a/ext/standard/tests/array/array_unique_variation3.phpt +++ b/ext/standard/tests/array/array_unique_variation3.phpt @@ -35,10 +35,6 @@ $inputs = array ( array(0 => "0", 1 => "0"), array(1 => "1", 2 => "2", 3 => 1, 4 => "4"), - // arrays with float keys -/*3*/ array(2.3333 => "float", 44.44 => "float"), - array(1.2 => "f1", 3.33 => "f2", 4.89999922839999 => "f1", 3333333.333333 => "f4"), - // arrays with string keys /*5*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 111), array("\tHello" => 111, "re\td" => "color", "\v\fworld" => 2.2, "pen\n" => 111), @@ -79,20 +75,6 @@ array(3) { string(1) "4" } -- Iteration 3 -- -array(1) { - [2]=> - string(5) "float" -} --- Iteration 4 -- -array(3) { - [1]=> - string(2) "f1" - [3]=> - string(2) "f2" - [3333333]=> - string(2) "f4" -} --- Iteration 5 -- array(3) { ["\tHello"]=> int(111) @@ -101,7 +83,7 @@ array(3) { ["\v\fworld"]=> float(2.2) } --- Iteration 6 -- +-- Iteration 4 -- array(3) { [" Hello"]=> int(111) @@ -110,14 +92,14 @@ array(3) { ["world"]=> float(2.2) } --- Iteration 7 -- +-- Iteration 5 -- array(2) { [0]=> string(5) "hello" ["Hello world"]=> string(6) "string" } --- Iteration 8 -- +-- Iteration 6 -- array(3) { [""]=> string(5) "hello" diff --git a/ext/standard/tests/array/array_unique_variation4.phpt b/ext/standard/tests/array/array_unique_variation4.phpt index 1912fe26ac..7b4f8bd443 100644 --- a/ext/standard/tests/array/array_unique_variation4.phpt +++ b/ext/standard/tests/array/array_unique_variation4.phpt @@ -35,13 +35,9 @@ $inputs = array ( /*1*/ array('0' => 0, '1' => 0), array("one" => 1, 'two' => 2, "three" => 1, 4 => 1), - // arrays with float values -/*3*/ array("float1" => 2.3333, "float2" => 2.3333), - array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 1.2), - // arrays with string values -/*5*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "\tHello"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => '\tHello'), +/*5*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "\tHello"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => '\tHello'), array(1 => "hello", "heredoc" => $heredoc, $heredoc), // array with object, unset variable and resource variable @@ -75,20 +71,6 @@ array(2) { int(2) } -- Iteration 3 -- -array(1) { - ["float1"]=> - float(2.3333) -} --- Iteration 4 -- -array(3) { - ["f1"]=> - float(1.2) - ["f2"]=> - float(3.33) - [3]=> - float(4.89999922839999) -} --- Iteration 5 -- array(3) { [111]=> string(6) " Hello" @@ -97,7 +79,7 @@ array(3) { [2]=> string(7) "world" } --- Iteration 6 -- +-- Iteration 4 -- array(3) { [111]=> string(7) "\tHello" @@ -106,14 +88,14 @@ array(3) { [2]=> string(9) "\v\fworld" } --- Iteration 7 -- +-- Iteration 5 -- array(2) { [1]=> string(5) "hello" ["heredoc"]=> string(11) "Hello world" } --- Iteration 8 -- +-- Iteration 6 -- array(3) { [11]=> object(classA)#%d (0) { diff --git a/ext/standard/tests/array/array_unshift_variation4.phpt b/ext/standard/tests/array/array_unshift_variation4.phpt index 0be7ab18e2..4a5c53c472 100644 --- a/ext/standard/tests/array/array_unshift_variation4.phpt +++ b/ext/standard/tests/array/array_unshift_variation4.phpt @@ -44,12 +44,6 @@ $arrays = array ( array(1 => "1"), array(1 => "1", 2 => "2", 3 => "3", 4 => "4"), - // arrays with float keys -/*5*/ array(2.3333 => "float"), - array(1.2 => "f1", 3.33 => "f2", - 4.89999922839999 => "f3", - 33333333.333333 => "f4"), - // arrays with string keys /*7*/ array('\tHello' => 111, 're\td' => "color", '\v\fworld' => 2.2, 'pen\n' => 33), @@ -184,56 +178,6 @@ array(7) { string(1) "4" } -- Iteration 5 -- -int(2) -array(2) { - [0]=> - int(10) - [1]=> - string(5) "float" -} -int(4) -array(4) { - [0]=> - int(10) - [1]=> - string(5) "hello" - [2]=> - string(5) "world" - [3]=> - string(5) "float" -} --- Iteration 6 -- -int(5) -array(5) { - [0]=> - int(10) - [1]=> - string(2) "f1" - [2]=> - string(2) "f2" - [3]=> - string(2) "f3" - [4]=> - string(2) "f4" -} -int(7) -array(7) { - [0]=> - int(10) - [1]=> - string(5) "hello" - [2]=> - string(5) "world" - [3]=> - string(2) "f1" - [4]=> - string(2) "f2" - [5]=> - string(2) "f3" - [6]=> - string(2) "f4" -} --- Iteration 7 -- int(5) array(5) { [0]=> @@ -264,7 +208,7 @@ array(7) { ["pen\n"]=> int(33) } --- Iteration 8 -- +-- Iteration 6 -- int(5) array(5) { [0]=> @@ -297,7 +241,7 @@ array(7) { "]=> int(33) } --- Iteration 9 -- +-- Iteration 7 -- int(3) array(3) { [0]=> @@ -320,7 +264,7 @@ array(5) { ["Hello world"]=> string(6) "string" } --- Iteration 10 -- +-- Iteration 8 -- int(3) array(3) { [0]=> @@ -343,7 +287,7 @@ array(5) { [3]=> string(8) "resource" } --- Iteration 11 -- +-- Iteration 9 -- int(8) array(8) { [0]=> diff --git a/ext/standard/tests/array/array_unshift_variation5.phpt b/ext/standard/tests/array/array_unshift_variation5.phpt index 6f642ed53e..ed3087cb57 100644 --- a/ext/standard/tests/array/array_unshift_variation5.phpt +++ b/ext/standard/tests/array/array_unshift_variation5.phpt @@ -51,8 +51,8 @@ $arrays = array ( array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333333), // arrays with string values -/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"), - array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'), +/*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3 => "pen\n"), + array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3 => 'pen\n'), array(1 => "hello", "heredoc" => $heredoc), // array with object, unset variable and resource variable diff --git a/ext/standard/tests/array/array_values_variation3.phpt b/ext/standard/tests/array/array_values_variation3.phpt index 9d5f322404..4d09a31fb8 100644 --- a/ext/standard/tests/array/array_values_variation3.phpt +++ b/ext/standard/tests/array/array_values_variation3.phpt @@ -29,18 +29,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e10 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -112,37 +100,19 @@ array(4) { string(8) "negative" } --- Iteration 2: float data -- -array(3) { - [0]=> - string(8) "positive" - [1]=> - string(8) "negative" - [2]=> - string(4) "half" -} - --- Iteration 3: extreme floats data -- -array(2) { - [0]=> - string(5) "large" - [1]=> - string(5) "small" -} - --- Iteration 4: null uppercase data -- +-- Iteration 2: null uppercase data -- array(1) { [0]=> string(6) "null 1" } --- Iteration 5: null lowercase data -- +-- Iteration 3: null lowercase data -- array(1) { [0]=> string(6) "null 2" } --- Iteration 6: bool lowercase data -- +-- Iteration 4: bool lowercase data -- array(2) { [0]=> string(6) "lowert" @@ -150,7 +120,7 @@ array(2) { string(6) "lowerf" } --- Iteration 7: bool uppercase data -- +-- Iteration 5: bool uppercase data -- array(2) { [0]=> string(6) "uppert" @@ -158,19 +128,19 @@ array(2) { string(6) "upperf" } --- Iteration 8: empty double quotes data -- +-- Iteration 6: empty double quotes data -- array(1) { [0]=> string(6) "emptyd" } --- Iteration 9: empty single quotes data -- +-- Iteration 7: empty single quotes data -- array(1) { [0]=> string(6) "emptys" } --- Iteration 10: string data -- +-- Iteration 8: string data -- array(3) { [0]=> string(7) "stringd" @@ -180,13 +150,13 @@ array(3) { string(7) "stringh" } --- Iteration 11: undefined data -- +-- Iteration 9: undefined data -- array(1) { [0]=> string(9) "undefined" } --- Iteration 12: unset data -- +-- Iteration 10: unset data -- array(1) { [0]=> string(5) "unset" diff --git a/ext/standard/tests/array/arsort_variation11.phpt b/ext/standard/tests/array/arsort_variation11.phpt Binary files differindex 10958375d9..2da7a6fce3 100644 --- a/ext/standard/tests/array/arsort_variation11.phpt +++ b/ext/standard/tests/array/arsort_variation11.phpt diff --git a/ext/standard/tests/array/asort_variation11.phpt b/ext/standard/tests/array/asort_variation11.phpt Binary files differindex e614d15433..e6112672a6 100644 --- a/ext/standard/tests/array/asort_variation11.phpt +++ b/ext/standard/tests/array/asort_variation11.phpt diff --git a/ext/standard/tests/array/count_invalid_mode.phpt b/ext/standard/tests/array/count_invalid_mode.phpt index 4f7950e727..710741d122 100644 --- a/ext/standard/tests/array/count_invalid_mode.phpt +++ b/ext/standard/tests/array/count_invalid_mode.phpt @@ -9,7 +9,6 @@ $modes = [ 0, 1, -1, - -1.45, 2, TRUE, FALSE, @@ -31,7 +30,6 @@ int(0) int(0) count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE -count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE int(0) int(0) int(0) diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index 321706bc24..278307aca0 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -27,15 +27,15 @@ echo "\n*** Testing possible variations of count() function on arrays ***"; $count_array = array( array(), array( 1 => "string"), - array( "" => "string", 0 => "a", NULL => "b", -1.00 => "c", + array( "" => "string", 0 => "a", NULL => "b", -1 => "c", array(array(array(NULL)))), - array( -2.44444 => 12, array(array(1, 2, array(array("0"))))), + array( -2 => 12, array(array(1, 2, array(array("0"))))), array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344), array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL, 1 => -2.344, array()), array( TRUE => TRUE, FALSE => FALSE, "" => "", " " => " ", NULL => NULL, "\x000" => "\x000", "\000" => "\000"), - array( NULL, 1.23 => "Hi", "string" => "hello", + array( NULL, 1 => "Hi", "string" => "hello", array("" => "World", "-2.34" => "a", "0" => "b")) ); diff --git a/ext/standard/tests/array/end_64bit.phpt b/ext/standard/tests/array/end_64bit.phpt index d4bc3c143e..5069c34629 100644 --- a/ext/standard/tests/array/end_64bit.phpt +++ b/ext/standard/tests/array/end_64bit.phpt @@ -14,7 +14,7 @@ $arrays = array ( range('a', 'z', 2 ), array("a" => "A", 2 => "B", "C" => 3, 4 => 4, "one" => 1, "" => NULL ), array(1, array(1, 2 => 3 ), "one" => 1, "5" => 5 ), - array(-1, -2, -3, -4, "-0.005" => "neg0.005", 2.0 => "float2", "neg.9" => -.9 ), + array(-1, -2, -3, -4, "-0.005" => "neg0.005", 2 => "float2", "neg.9" => -.9 ), array(1.0005, 2.000000, -3.000000, -4.9999999 ), array(true, false), array("PHP", "Web2.0", "SOA"), diff --git a/ext/standard/tests/array/extract_variation4.phpt b/ext/standard/tests/array/extract_variation4.phpt index d755a6a214..cdbbce225c 100644 --- a/ext/standard/tests/array/extract_variation4.phpt +++ b/ext/standard/tests/array/extract_variation4.phpt @@ -5,8 +5,8 @@ Test extract() function (variation 4) $mixed_array = array( array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ), - array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), + array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ), array( 12, "name", 'age', '45' ), ); diff --git a/ext/standard/tests/array/extract_variation5.phpt b/ext/standard/tests/array/extract_variation5.phpt index 91867b1112..9ddefd4aaa 100644 --- a/ext/standard/tests/array/extract_variation5.phpt +++ b/ext/standard/tests/array/extract_variation5.phpt @@ -6,7 +6,7 @@ Test extract() function (variation 5) $mixed_array = array( array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ), array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, - 5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 ) + 5 => 57, "5.4" => 554, "5.7" => 557 ) ); $counter = 0; diff --git a/ext/standard/tests/array/extract_variation7.phpt b/ext/standard/tests/array/extract_variation7.phpt index eb5171bfc7..268a247736 100644 --- a/ext/standard/tests/array/extract_variation7.phpt +++ b/ext/standard/tests/array/extract_variation7.phpt @@ -8,8 +8,8 @@ echo "\n*** Testing for EXTR_PREFIX_ALL called twice with same prefix string *** $a = array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ); var_dump ( extract($a, EXTR_PREFIX_ALL, "same")); -$b = array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ); +$b = array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2 => "float", "F" => "FFF", + "blank" => "", 3 => 3.7, 5 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ); var_dump ( extract($b, EXTR_PREFIX_ALL, "same")); var_dump ( extract($b, EXTR_PREFIX_ALL, "diff")); diff --git a/ext/standard/tests/array/in_array_variation1.phpt b/ext/standard/tests/array/in_array_variation1.phpt index 6bb0b36d34..0c88a45332 100644 --- a/ext/standard/tests/array/in_array_variation1.phpt +++ b/ext/standard/tests/array/in_array_variation1.phpt @@ -9,7 +9,7 @@ $arrays = array ( array(0), array("a" => "A", 2 => "B", "C" => 3, 4 => 4, "one" => 1, "" => NULL, "b", "ab", "abcd"), array(4, array(1, 2 => 3), "one" => 1, "5" => 5 ), - array(-1, -2, -3, -4, -2.989888, "-0.005" => "neg0.005", 2.0 => "float2", "-.9" => -.9), + array(-1, -2, -3, -4, -2.989888, "-0.005" => "neg0.005", 2 => "float2", "-.9" => -.9), array(TRUE, FALSE), array("", array()), array("abcd\x00abcd\x00abcd"), diff --git a/ext/standard/tests/array/in_array_variation2.phpt b/ext/standard/tests/array/in_array_variation2.phpt index af4191577a..3976232243 100644 --- a/ext/standard/tests/array/in_array_variation2.phpt +++ b/ext/standard/tests/array/in_array_variation2.phpt @@ -11,7 +11,7 @@ $misc_array = array ( 3, ".001" =>-67, "-.051" =>"k", - 0.091 =>"-.08", + 0 =>"-.08", "e" =>"5", "y" =>NULL, NULL =>"", diff --git a/ext/standard/tests/array/key_variation2.phpt b/ext/standard/tests/array/key_variation2.phpt index 1107999c10..d1eed890ff 100644 --- a/ext/standard/tests/array/key_variation2.phpt +++ b/ext/standard/tests/array/key_variation2.phpt @@ -28,18 +28,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e6 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -107,42 +95,33 @@ int(1) int(12345) int(-2345) --- Iteration 2 : float data -- -int(10) -int(-10) -int(0) - --- Iteration 3 : extreme floats data -- -int(12345678) -int(0) - --- Iteration 4 : null uppercase data -- +-- Iteration 2 : null uppercase data -- string(0) "" --- Iteration 5 : null lowercase data -- +-- Iteration 3 : null lowercase data -- string(0) "" --- Iteration 6 : bool lowercase data -- +-- Iteration 4 : bool lowercase data -- int(1) int(0) --- Iteration 7 : bool uppercase data -- +-- Iteration 5 : bool uppercase data -- int(1) int(0) --- Iteration 8 : empty double quotes data -- +-- Iteration 6 : empty double quotes data -- string(0) "" --- Iteration 9 : empty single quotes data -- +-- Iteration 7 : empty single quotes data -- string(0) "" --- Iteration 10 : string data -- +-- Iteration 8 : string data -- string(7) "stringd" string(7) "strings" string(11) "hello world" --- Iteration 11 : undefined data -- +-- Iteration 9 : undefined data -- string(0) "" --- Iteration 12 : unset data -- +-- Iteration 10 : unset data -- string(0) "" diff --git a/ext/standard/tests/array/krsort_variation3.phpt b/ext/standard/tests/array/krsort_variation3.phpt index ffc6cc356e..979d38442e 100644 --- a/ext/standard/tests/array/krsort_variation3.phpt +++ b/ext/standard/tests/array/krsort_variation3.phpt @@ -14,12 +14,9 @@ echo "*** Testing krsort() : usage variations ***\n"; // diff. associative arrays to sort $various_arrays = array( - // negative/posative integer key value array + // negative/positive integer key value array array(1 => 11, -2 => -11, 3 => 21, -4 => -21, 5 => 31, -6 => -31, 7 => 0, 8 => 41, -10 =>-41), - // float key values - array(1.0 => 10.5, 0.2 => -10.5, 3.1 => 10.5e2, 4 => 10.6E-2, .5 => .5, 6 => .0001, -7 => -.1), - // mixed value array with different types of keys array(1 => .0001, 2 => .0021, -3 => -.01, 4 => -1, 5 => 0, 6 => .09, 7 => 2, -8 => -.9, 9 => 10.6E-2, -10 => -10.6E-2, 11 => 33) @@ -128,56 +125,6 @@ array(9) { -- Iteration 2 -- - With default sort flag - bool(true) -array(6) { - [6]=> - float(0.0001) - [4]=> - float(0.106) - [3]=> - float(1050) - [1]=> - float(10.5) - [0]=> - float(0.5) - [-7]=> - float(-0.1) -} -- Sort flag = SORT_REGULAR - -bool(true) -array(6) { - [6]=> - float(0.0001) - [4]=> - float(0.106) - [3]=> - float(1050) - [1]=> - float(10.5) - [0]=> - float(0.5) - [-7]=> - float(-0.1) -} -- Sort flag = SORT_NUMERIC - -bool(true) -array(6) { - [6]=> - float(0.0001) - [4]=> - float(0.106) - [3]=> - float(1050) - [1]=> - float(10.5) - [0]=> - float(0.5) - [-7]=> - float(-0.1) -} - --- Iteration 3 -- -- With default sort flag - -bool(true) array(11) { [11]=> int(33) diff --git a/ext/standard/tests/array/krsort_variation8.phpt b/ext/standard/tests/array/krsort_variation8.phpt Binary files differindex 1483e6fd1b..ff843f0b97 100644 --- a/ext/standard/tests/array/krsort_variation8.phpt +++ b/ext/standard/tests/array/krsort_variation8.phpt diff --git a/ext/standard/tests/array/ksort_variation3.phpt b/ext/standard/tests/array/ksort_variation3.phpt index db3d558be1..35954ba656 100644 --- a/ext/standard/tests/array/ksort_variation3.phpt +++ b/ext/standard/tests/array/ksort_variation3.phpt @@ -17,9 +17,6 @@ $various_arrays = array( // negative/posative integer key value array array(1 => 11, -2 => -11, 3 => 21, -4 => -21, 5 => 31, -6 => -31, 7 => 0, 8 => 41, -10 =>-41), - // float key values - array(1.0 => 10.5, 0.2 => -10.5, 3.1 => 10.5e2, 4 => 10.6E-2, .5 => .5, 6 => .0001, -7 => -.1), - // mixed value array with different types of keys array(1 => .0001, 2 => .0021, -3 => -.01, 4 => -1, 5 => 0, 6 => .09, 7 => 2, -8 => -.9, 9 => 10.6E-2, -10 => -10.6E-2, 11 => 33) @@ -128,56 +125,6 @@ array(9) { -- Iteration 2 -- - With default sort flag - bool(true) -array(6) { - [-7]=> - float(-0.1) - [0]=> - float(0.5) - [1]=> - float(10.5) - [3]=> - float(1050) - [4]=> - float(0.106) - [6]=> - float(0.0001) -} -- Sort flag = SORT_REGULAR - -bool(true) -array(6) { - [-7]=> - float(-0.1) - [0]=> - float(0.5) - [1]=> - float(10.5) - [3]=> - float(1050) - [4]=> - float(0.106) - [6]=> - float(0.0001) -} -- Sort flag = SORT_NUMERIC - -bool(true) -array(6) { - [-7]=> - float(-0.1) - [0]=> - float(0.5) - [1]=> - float(10.5) - [3]=> - float(1050) - [4]=> - float(0.106) - [6]=> - float(0.0001) -} - --- Iteration 3 -- -- With default sort flag - -bool(true) array(11) { [-10]=> float(-0.106) diff --git a/ext/standard/tests/array/ksort_variation8.phpt b/ext/standard/tests/array/ksort_variation8.phpt Binary files differindex 7b7e1c003e..fe27e6328d 100644 --- a/ext/standard/tests/array/ksort_variation8.phpt +++ b/ext/standard/tests/array/ksort_variation8.phpt diff --git a/ext/standard/tests/array/natcasesort_variation11.phpt b/ext/standard/tests/array/natcasesort_variation11.phpt index c47cda6ab3..5934b5230c 100644 --- a/ext/standard/tests/array/natcasesort_variation11.phpt +++ b/ext/standard/tests/array/natcasesort_variation11.phpt @@ -28,18 +28,6 @@ $inputs = array( -2345 => 'negative', ), - // float data -/*2*/ 'float' => array( - 10.5 => 'positive', - -10.5 => 'negative', - .5 => 'half', - ), - -/*3*/ 'extreme floats' => array( - 12.3456789000e6 => 'large', - 12.3456789000E-10 => 'small', - ), - // null data /*4*/ 'null uppercase' => array( NULL => 'null 1', @@ -124,39 +112,19 @@ array(4) { -- Iteration 2 -- bool(true) -array(3) { - [0]=> - string(4) "half" - [-10]=> - string(8) "negative" - [10]=> - string(8) "positive" -} - --- Iteration 3 -- -bool(true) -array(2) { - [12345678]=> - string(5) "large" - [0]=> - string(5) "small" -} - --- Iteration 4 -- -bool(true) array(1) { [""]=> string(6) "null 1" } --- Iteration 5 -- +-- Iteration 3 -- bool(true) array(1) { [""]=> string(6) "null 2" } --- Iteration 6 -- +-- Iteration 4 -- bool(true) array(2) { [0]=> @@ -165,7 +133,7 @@ array(2) { string(6) "lowert" } --- Iteration 7 -- +-- Iteration 5 -- bool(true) array(2) { [0]=> @@ -174,21 +142,21 @@ array(2) { string(6) "uppert" } --- Iteration 8 -- +-- Iteration 6 -- bool(true) array(1) { [""]=> string(6) "emptyd" } --- Iteration 9 -- +-- Iteration 7 -- bool(true) array(1) { [""]=> string(6) "emptys" } --- Iteration 10 -- +-- Iteration 8 -- bool(true) array(3) { ["stringd"]=> @@ -199,21 +167,21 @@ array(3) { string(7) "strings" } --- Iteration 11 -- +-- Iteration 9 -- bool(true) array(1) { [""]=> string(9) "undefined" } --- Iteration 12 -- +-- Iteration 10 -- bool(true) array(1) { [""]=> string(5) "unset" } --- Iteration 13 -- +-- Iteration 11 -- bool(true) array(3) { ["foo"]=> diff --git a/ext/standard/tests/array/shuffle_variation4.phpt b/ext/standard/tests/array/shuffle_variation4.phpt index 629c449b7f..1d3269e76e 100644 --- a/ext/standard/tests/array/shuffle_variation4.phpt +++ b/ext/standard/tests/array/shuffle_variation4.phpt @@ -21,7 +21,7 @@ $array_arg = array( /*3*/ array("float1" => 0.23, 'float2' => 1.34, "exp1" => 0e2, 'exp2' => 200e-2, "exp3" => 10e0), // array with negative float values - array(-0.23 => -0.23, -1.34 => -1.34, -200e-2 => -200e-2, -30 => -30e0, -2147473649.80), + array(-0 => -0.23, -1 => -1.34, -200 => -200e-2, -30 => -30e0, -2147473649.80), // array with single and double quoted strings /*5*/ array('1' => 'one', "str1" => "123numbers", '' => 'hello\tworld', "" => "hello world\0", "12.34floatnum"), |