From 5c62735f174576f67ddd8779000653dbc9ddc26a Mon Sep 17 00:00:00 2001 From: Josie Messa Date: Fri, 15 Feb 2008 16:04:35 +0000 Subject: [PATCH] - New tests for rsort() function --- ext/standard/tests/array/rsort_basic.phpt | 204 ++++ ext/standard/tests/array/rsort_error.phpt | 70 ++ ext/standard/tests/array/rsort_object1.phpt | 402 ++++++++ ext/standard/tests/array/rsort_object2.phpt | 421 ++++++++ .../tests/array/rsort_variation1.phpt | 925 ++++++++++++++++++ .../tests/array/rsort_variation10.phpt | 180 ++++ .../tests/array/rsort_variation11.phpt | Bin 0 -> 4474 bytes .../tests/array/rsort_variation2.phpt | 861 ++++++++++++++++ .../tests/array/rsort_variation3.phpt | 584 +++++++++++ .../tests/array/rsort_variation4.phpt | 116 +++ .../tests/array/rsort_variation5.phpt | 393 ++++++++ .../tests/array/rsort_variation6.phpt | 204 ++++ .../tests/array/rsort_variation7.phpt | 151 +++ .../tests/array/rsort_variation8.phpt | 307 ++++++ .../tests/array/rsort_variation9.phpt | 462 +++++++++ 15 files changed, 5280 insertions(+) create mode 100644 ext/standard/tests/array/rsort_basic.phpt create mode 100644 ext/standard/tests/array/rsort_error.phpt create mode 100644 ext/standard/tests/array/rsort_object1.phpt create mode 100644 ext/standard/tests/array/rsort_object2.phpt create mode 100644 ext/standard/tests/array/rsort_variation1.phpt create mode 100644 ext/standard/tests/array/rsort_variation10.phpt create mode 100644 ext/standard/tests/array/rsort_variation11.phpt create mode 100644 ext/standard/tests/array/rsort_variation2.phpt create mode 100644 ext/standard/tests/array/rsort_variation3.phpt create mode 100644 ext/standard/tests/array/rsort_variation4.phpt create mode 100644 ext/standard/tests/array/rsort_variation5.phpt create mode 100644 ext/standard/tests/array/rsort_variation6.phpt create mode 100644 ext/standard/tests/array/rsort_variation7.phpt create mode 100644 ext/standard/tests/array/rsort_variation8.phpt create mode 100644 ext/standard/tests/array/rsort_variation9.phpt diff --git a/ext/standard/tests/array/rsort_basic.phpt b/ext/standard/tests/array/rsort_basic.phpt new file mode 100644 index 0000000000..74da415a3a --- /dev/null +++ b/ext/standard/tests/array/rsort_basic.phpt @@ -0,0 +1,204 @@ +--TEST-- +Test rsort() function : basic functionality +--FILE-- + "lemon", "o" => "orange", "b" => "banana" ); + +// array with default keys containing unsorted numeric values +$unsorted_numerics = array( 100, 33, 555, 22 ); + +echo "\n-- Testing rsort() by supplying string array, 'flag' value is defualt --\n"; +$temp_array = $unsorted_strings; +var_dump( rsort($temp_array) ); +var_dump( $temp_array); + +echo "\n-- Testing rsort() by supplying numeric array, 'flag' value is defualt --\n"; +$temp_array = $unsorted_numerics; +var_dump( rsort($temp_array) ); +var_dump( $temp_array); + +echo "\n-- Testing rsort() by supplying string array, 'flag' = SORT_REGULAR --\n"; +$temp_array = $unsorted_strings; +var_dump( rsort($temp_array, SORT_REGULAR) ); +var_dump( $temp_array); + +echo "\n-- Testing rsort() by supplying numeric array, 'flag' = SORT_REGULAR --\n"; +$temp_array = $unsorted_numerics; +var_dump( rsort($temp_array, SORT_REGULAR) ); +var_dump( $temp_array); + +echo "\n-- Testing rsort() by supplying string array, 'flag' = SORT_STRING --\n"; +$temp_array = $unsorted_strings; +var_dump( rsort($temp_array, SORT_STRING) ); +var_dump( $temp_array); + +echo "\n-- Testing rsort() by supplying numeric array, 'flag' = SORT_NUMERIC --\n"; +$temp_array = $unsorted_numerics; +var_dump( rsort($temp_array, SORT_NUMERIC) ); +var_dump( $temp_array); + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : basic functionality *** + +-- Testing rsort() by supplying string array, 'flag' value is defualt -- +bool(true) +array(3) { + [0]=> + string(6) "orange" + [1]=> + string(5) "lemon" + [2]=> + string(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' value is defualt -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} + +-- Testing rsort() by supplying string array, 'flag' = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + string(6) "orange" + [1]=> + string(5) "lemon" + [2]=> + string(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} + +-- Testing rsort() by supplying string array, 'flag' = SORT_STRING -- +bool(true) +array(3) { + [0]=> + string(6) "orange" + [1]=> + string(5) "lemon" + [2]=> + string(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' = SORT_NUMERIC -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} +Done +--UEXPECTF-- +*** Testing rsort() : basic functionality *** + +-- Testing rsort() by supplying string array, 'flag' value is defualt -- +bool(true) +array(3) { + [0]=> + unicode(6) "orange" + [1]=> + unicode(5) "lemon" + [2]=> + unicode(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' value is defualt -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} + +-- Testing rsort() by supplying string array, 'flag' = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + unicode(6) "orange" + [1]=> + unicode(5) "lemon" + [2]=> + unicode(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} + +-- Testing rsort() by supplying string array, 'flag' = SORT_STRING -- +bool(true) +array(3) { + [0]=> + unicode(6) "orange" + [1]=> + unicode(5) "lemon" + [2]=> + unicode(6) "banana" +} + +-- Testing rsort() by supplying numeric array, 'flag' = SORT_NUMERIC -- +bool(true) +array(4) { + [0]=> + int(555) + [1]=> + int(100) + [2]=> + int(33) + [3]=> + int(22) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_error.phpt b/ext/standard/tests/array/rsort_error.phpt new file mode 100644 index 0000000000..5123efb5f8 --- /dev/null +++ b/ext/standard/tests/array/rsort_error.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test rsort() function : error conditions - Pass incorrect number of args +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : error conditions *** + +-- Testing rsort() function with Zero arguments -- + +Warning: rsort() expects at least 1 parameter, 0 given in %s on line %d +bool(false) + +-- Testing rsort() function with more than expected no. of arguments -- + +Warning: rsort() expects at most 2 parameters, 3 given in %s on line %d +bool(false) +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +Done +--UEXPECTF-- +*** Testing rsort() : error conditions *** + +-- Testing rsort() function with Zero arguments -- + +Warning: rsort() expects at least 1 parameter, 0 given in %s on line %d +bool(false) + +-- Testing rsort() function with more than expected no. of arguments -- + +Warning: rsort() expects at most 2 parameters, 3 given in %s on line %d +bool(false) +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_object1.phpt b/ext/standard/tests/array/rsort_object1.phpt new file mode 100644 index 0000000000..997992dd4c --- /dev/null +++ b/ext/standard/tests/array/rsort_object1.phpt @@ -0,0 +1,402 @@ +--TEST-- +Test rsort() function : object functionality +--FILE-- +class_value = $value; + } + +} + +// class declaration for string objects +class for_string_rsort +{ + public $class_value; + // initializing object member value + function __construct($value){ + $this->class_value = $value; + } + + // return string value + function __tostring() { + return (string)$this->value; + } + +} + +// array of integer objects +$unsorted_int_obj = array( + new for_integer_rsort(11), new for_integer_rsort(66), + new for_integer_rsort(23), new for_integer_rsort(-5), + new for_integer_rsort(0.001), new for_integer_rsort(0) +); + +// array of string objects +$unsorted_str_obj = array ( + new for_string_rsort("axx"), new for_string_rsort("t"), + new for_string_rsort("w"), new for_string_rsort("py"), + new for_string_rsort("apple"), new for_string_rsort("Orange"), + new for_string_rsort("Lemon"), new for_string_rsort("aPPle") +); + + +echo "\n-- Sort flag = default --\n"; + +// testing rsort() function by supplying integer object array, flag value is defualt +$temp_array = $unsorted_int_obj; +var_dump(rsort($temp_array) ); +var_dump($temp_array); + +// testing rsort() function by supplying string object array, flag value is defualt +$temp_array = $unsorted_str_obj; +var_dump(rsort($temp_array) ); +var_dump($temp_array); + +echo "\n-- Sort flag = SORT_REGULAR --\n"; +// testing rsort() function by supplying integer object array, flag value = SORT_REGULAR +$temp_array = $unsorted_int_obj; +var_dump(rsort($temp_array, SORT_REGULAR) ); +var_dump($temp_array); + +// testing rsort() function by supplying string object array, flag value = SORT_REGULAR +$temp_array = $unsorted_str_obj; +var_dump(rsort($temp_array, SORT_REGULAR) ); +var_dump($temp_array); + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : object functionality *** + +-- Sort flag = default -- +bool(true) +array(6) { + [0]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(66) + } + [1]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(23) + } + [2]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(11) + } + [3]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + float(0.001) + } + [4]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(0) + } + [5]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(-5) + } +} +bool(true) +array(8) { + [0]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(1) "w" + } + [1]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(1) "t" + } + [2]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(2) "py" + } + [3]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(3) "axx" + } + [4]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "apple" + } + [5]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "aPPle" + } + [6]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(6) "Orange" + } + [7]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "Lemon" + } +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(6) { + [0]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(66) + } + [1]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(23) + } + [2]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(11) + } + [3]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + float(0.001) + } + [4]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(0) + } + [5]=> + object(for_integer_rsort)#%d (1) { + ["class_value"]=> + int(-5) + } +} +bool(true) +array(8) { + [0]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(1) "w" + } + [1]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(1) "t" + } + [2]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(2) "py" + } + [3]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(3) "axx" + } + [4]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "apple" + } + [5]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "aPPle" + } + [6]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(6) "Orange" + } + [7]=> + object(for_string_rsort)#%d (1) { + ["class_value"]=> + string(5) "Lemon" + } +} +Done +--UEXPECTF-- +*** Testing rsort() : object functionality *** + +-- Sort flag = default -- +bool(true) +array(6) { + [0]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(66) + } + [1]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(23) + } + [2]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(11) + } + [3]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + float(0.001) + } + [4]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(0) + } + [5]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(-5) + } +} +bool(true) +array(8) { + [0]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(1) "w" + } + [1]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(1) "t" + } + [2]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(2) "py" + } + [3]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(3) "axx" + } + [4]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "apple" + } + [5]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "aPPle" + } + [6]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(6) "Orange" + } + [7]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "Lemon" + } +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(6) { + [0]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(66) + } + [1]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(23) + } + [2]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(11) + } + [3]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + float(0.001) + } + [4]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(0) + } + [5]=> + object(for_integer_rsort)#%d (1) { + [u"class_value"]=> + int(-5) + } +} +bool(true) +array(8) { + [0]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(1) "w" + } + [1]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(1) "t" + } + [2]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(2) "py" + } + [3]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(3) "axx" + } + [4]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "apple" + } + [5]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "aPPle" + } + [6]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(6) "Orange" + } + [7]=> + object(for_string_rsort)#%d (1) { + [u"class_value"]=> + unicode(5) "Lemon" + } +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_object2.phpt b/ext/standard/tests/array/rsort_object2.phpt new file mode 100644 index 0000000000..ad44409271 --- /dev/null +++ b/ext/standard/tests/array/rsort_object2.phpt @@ -0,0 +1,421 @@ +--TEST-- +Test rsort() function : object functionality - different visibilities +--FILE-- +public_class_value = $value1; + $this->private_class_value = $value2; + $this->protected_class_value = $value3; + } + +} + +// class declaration for string objects +class for_string_rsort +{ + public $public_class_value; + private $private_class_value; + protected $protected_class_value; + // initializing object member value + function __construct($value1, $value2,$value3){ + $this->public_class_value = $value1; + $this->private_class_value = $value2; + $this->protected_class_value = $value3; + } + + // return string value + function __tostring() { + return (string)$this->value; + } + +} + +// array of integer objects + +$unsorted_int_obj = array( + new for_integer_rsort(11,33,30), + new for_integer_rsort(66,44,4), + new for_integer_rsort(-88,-5,5), + new for_integer_rsort(0.001,99.5,0.1) +); + +// array of string objects +$unsorted_str_obj = array ( + new for_string_rsort("axx","AXX","ass"), + new for_string_rsort("t","eee","abb"), + new for_string_rsort("w","W", "c"), + new for_string_rsort("py","PY", "pt"), +); + + +echo "\n-- Sort flag = default --\n"; + +// testing rsort() function by supplying integer object array, flag value is defualt +$temp_array = $unsorted_int_obj; +var_dump(rsort($temp_array) ); +var_dump($temp_array); + +// testing rsort() function by supplying string object array, flag value is defualt +$temp_array = $unsorted_str_obj; +var_dump(rsort($temp_array) ); +var_dump($temp_array); + +echo "\n-- Sort flag = SORT_REGULAR --\n"; +// testing rsort() function by supplying integer object array, flag value = SORT_REGULAR +$temp_array = $unsorted_int_obj; +var_dump(rsort($temp_array, SORT_REGULAR) ); +var_dump($temp_array); + +// testing rsort() function by supplying string object array, flag value = SORT_REGULAR +$temp_array = $unsorted_str_obj; +var_dump(rsort($temp_array, SORT_REGULAR) ); +var_dump($temp_array); + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : object functionality *** + +-- Sort flag = default -- +bool(true) +array(4) { + [0]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(66) + ["private_class_value":"for_integer_rsort":private]=> + int(44) + ["protected_class_value":protected]=> + int(4) + } + [1]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(11) + ["private_class_value":"for_integer_rsort":private]=> + int(33) + ["protected_class_value":protected]=> + int(30) + } + [2]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + float(0.001) + ["private_class_value":"for_integer_rsort":private]=> + float(99.5) + ["protected_class_value":protected]=> + float(0.1) + } + [3]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(-88) + ["private_class_value":"for_integer_rsort":private]=> + int(-5) + ["protected_class_value":protected]=> + int(5) + } +} +bool(true) +array(4) { + [0]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(1) "w" + ["private_class_value":"for_string_rsort":private]=> + string(1) "W" + ["protected_class_value":protected]=> + string(1) "c" + } + [1]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(1) "t" + ["private_class_value":"for_string_rsort":private]=> + string(3) "eee" + ["protected_class_value":protected]=> + string(3) "abb" + } + [2]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(2) "py" + ["private_class_value":"for_string_rsort":private]=> + string(2) "PY" + ["protected_class_value":protected]=> + string(2) "pt" + } + [3]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(3) "axx" + ["private_class_value":"for_string_rsort":private]=> + string(3) "AXX" + ["protected_class_value":protected]=> + string(3) "ass" + } +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(66) + ["private_class_value":"for_integer_rsort":private]=> + int(44) + ["protected_class_value":protected]=> + int(4) + } + [1]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(11) + ["private_class_value":"for_integer_rsort":private]=> + int(33) + ["protected_class_value":protected]=> + int(30) + } + [2]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + float(0.001) + ["private_class_value":"for_integer_rsort":private]=> + float(99.5) + ["protected_class_value":protected]=> + float(0.1) + } + [3]=> + object(for_integer_rsort)#%d (3) { + ["public_class_value"]=> + int(-88) + ["private_class_value":"for_integer_rsort":private]=> + int(-5) + ["protected_class_value":protected]=> + int(5) + } +} +bool(true) +array(4) { + [0]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(1) "w" + ["private_class_value":"for_string_rsort":private]=> + string(1) "W" + ["protected_class_value":protected]=> + string(1) "c" + } + [1]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(1) "t" + ["private_class_value":"for_string_rsort":private]=> + string(3) "eee" + ["protected_class_value":protected]=> + string(3) "abb" + } + [2]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(2) "py" + ["private_class_value":"for_string_rsort":private]=> + string(2) "PY" + ["protected_class_value":protected]=> + string(2) "pt" + } + [3]=> + object(for_string_rsort)#%d (3) { + ["public_class_value"]=> + string(3) "axx" + ["private_class_value":"for_string_rsort":private]=> + string(3) "AXX" + ["protected_class_value":protected]=> + string(3) "ass" + } +} +Done +--UEXPECTF-- +*** Testing rsort() : object functionality *** + +-- Sort flag = default -- +bool(true) +array(4) { + [0]=> + object(for_integer_rsort)#2 (3) { + [u"public_class_value"]=> + int(66) + [u"private_class_value":u"for_integer_rsort":private]=> + int(44) + [u"protected_class_value":protected]=> + int(4) + } + [1]=> + object(for_integer_rsort)#1 (3) { + [u"public_class_value"]=> + int(11) + [u"private_class_value":u"for_integer_rsort":private]=> + int(33) + [u"protected_class_value":protected]=> + int(30) + } + [2]=> + object(for_integer_rsort)#4 (3) { + [u"public_class_value"]=> + float(0.001) + [u"private_class_value":u"for_integer_rsort":private]=> + float(99.5) + [u"protected_class_value":protected]=> + float(0.1) + } + [3]=> + object(for_integer_rsort)#3 (3) { + [u"public_class_value"]=> + int(-88) + [u"private_class_value":u"for_integer_rsort":private]=> + int(-5) + [u"protected_class_value":protected]=> + int(5) + } +} +bool(true) +array(4) { + [0]=> + object(for_string_rsort)#7 (3) { + [u"public_class_value"]=> + unicode(1) "w" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(1) "W" + [u"protected_class_value":protected]=> + unicode(1) "c" + } + [1]=> + object(for_string_rsort)#6 (3) { + [u"public_class_value"]=> + unicode(1) "t" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(3) "eee" + [u"protected_class_value":protected]=> + unicode(3) "abb" + } + [2]=> + object(for_string_rsort)#8 (3) { + [u"public_class_value"]=> + unicode(2) "py" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(2) "PY" + [u"protected_class_value":protected]=> + unicode(2) "pt" + } + [3]=> + object(for_string_rsort)#5 (3) { + [u"public_class_value"]=> + unicode(3) "axx" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(3) "AXX" + [u"protected_class_value":protected]=> + unicode(3) "ass" + } +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + object(for_integer_rsort)#2 (3) { + [u"public_class_value"]=> + int(66) + [u"private_class_value":u"for_integer_rsort":private]=> + int(44) + [u"protected_class_value":protected]=> + int(4) + } + [1]=> + object(for_integer_rsort)#1 (3) { + [u"public_class_value"]=> + int(11) + [u"private_class_value":u"for_integer_rsort":private]=> + int(33) + [u"protected_class_value":protected]=> + int(30) + } + [2]=> + object(for_integer_rsort)#4 (3) { + [u"public_class_value"]=> + float(0.001) + [u"private_class_value":u"for_integer_rsort":private]=> + float(99.5) + [u"protected_class_value":protected]=> + float(0.1) + } + [3]=> + object(for_integer_rsort)#3 (3) { + [u"public_class_value"]=> + int(-88) + [u"private_class_value":u"for_integer_rsort":private]=> + int(-5) + [u"protected_class_value":protected]=> + int(5) + } +} +bool(true) +array(4) { + [0]=> + object(for_string_rsort)#7 (3) { + [u"public_class_value"]=> + unicode(1) "w" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(1) "W" + [u"protected_class_value":protected]=> + unicode(1) "c" + } + [1]=> + object(for_string_rsort)#6 (3) { + [u"public_class_value"]=> + unicode(1) "t" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(3) "eee" + [u"protected_class_value":protected]=> + unicode(3) "abb" + } + [2]=> + object(for_string_rsort)#8 (3) { + [u"public_class_value"]=> + unicode(2) "py" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(2) "PY" + [u"protected_class_value":protected]=> + unicode(2) "pt" + } + [3]=> + object(for_string_rsort)#5 (3) { + [u"public_class_value"]=> + unicode(3) "axx" + [u"private_class_value":u"for_string_rsort":private]=> + unicode(3) "AXX" + [u"protected_class_value":protected]=> + unicode(3) "ass" + } +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation1.phpt b/ext/standard/tests/array/rsort_variation1.phpt new file mode 100644 index 0000000000..e343dc9b17 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation1.phpt @@ -0,0 +1,925 @@ +--TEST-- +Test rsort() function : usage variations - Pass different data types as $array_arg arg +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : variation *** +-- Iteration 1 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 2 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 3 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 4 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 5 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 6 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 7 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 8 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 9 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 10 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 11 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 12 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 13 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 14 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 15 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 16 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +-- Iteration 17 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +-- Iteration 18 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +-- Iteration 19 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +-- Iteration 20 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, string given in %s on line %d +bool(false) +-- Iteration 21 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +-- Iteration 22 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 23 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 24 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Done +--UEXPECTF-- +*** Testing rsort() : variation *** +-- Iteration 1 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 2 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 3 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 4 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, integer given in %s on line %d +bool(false) +-- Iteration 5 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 6 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 7 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 8 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 9 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, double given in %s on line %d +bool(false) +-- Iteration 10 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 11 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 12 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 13 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 14 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 15 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, boolean given in %s on line %d +bool(false) +-- Iteration 16 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +-- Iteration 17 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +-- Iteration 18 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +-- Iteration 19 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +-- Iteration 20 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, Unicode string given in %s on line %d +bool(false) +-- Iteration 21 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, object given in %s on line %d +bool(false) +-- Iteration 22 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 23 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, null given in %s on line %d +bool(false) +-- Iteration 24 -- +Flag = default: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_REGULAR: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_NUMERIC: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Flag = SORT_STRING: + +Warning: rsort() expects parameter 1 to be array, resource given in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation10.phpt b/ext/standard/tests/array/rsort_variation10.phpt new file mode 100644 index 0000000000..a65b4405b5 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation10.phpt @@ -0,0 +1,180 @@ +--TEST-- +Test rsort() function : usage variations - Octal values +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Sort flag = default -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} + +-- Sort flag = SORT_NUMERIC -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Sort flag = default -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} + +-- Sort flag = SORT_REGULAR -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} + +-- Sort flag = SORT_NUMERIC -- +bool(true) +array(9) { + [0]=> + int(669) + [1]=> + int(506) + [2]=> + int(229) + [3]=> + int(209) + [4]=> + int(63) + [5]=> + int(54) + [6]=> + int(0) + [7]=> + int(-54) + [8]=> + int(-229) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation11.phpt b/ext/standard/tests/array/rsort_variation11.phpt new file mode 100644 index 0000000000000000000000000000000000000000..d2620eb658975a43a07b4a27cacd2b57bb654a62 GIT binary patch literal 4474 zcmeHKZEG4q5bo#u6@y4~C%3+wnkJ@6D2*uvX+tznFhN#tO%BYR?46QO^4~kNFQ-=( zQrZtK^+Ikp^UV9s>|7Wdbo&FwoPkI)kZB?_*MsRIo@7xHLkAWqzZbCNGU7x@fx%<+ zBtqa)@@I#!%g?_07{ROWM;G~et26}>xj#H82S*!8I;NB zXgcHf>7D051ujH7kN?R1)=Ndb!Q~~0*ap?pt*G$fqe6|oKb7hsrks_sVY65f}&^y=jF*vg~OS9<% zYx{7hG0=|+(rq-h5QBgO+FKBhlPn9E5#jc!USD64;o!iB47K<$<+D^c9%f4? z_cmrsA3jwE<|hD$3&}ijuv|ys;&JZkf?nhG08QlZI$1a9F=PJ;PN~Tbj5cTcBxybqJ`L-DVS8SUtmr)yePqy zn5paCwy@-th!M=SnwWMAVz@h~tD?sE-TZtTL`dU38^YI3A zOEEW0aZG0k&)gQJaM&=1tZ8*kGojO=8%i-~EFX1)CLya0fr*Z;Hs@udqt;s)?}dF^?b~YKR{F00 zmA0Z0hr{Y-Ki>4kYX|1PFy0n%M4#Q8^DPJL?AkuyESu$0cfYy%Ew(x0EV6CJS?qN~ zZk_v2O*yM`+nBT1YM%WR> + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 2 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 3 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 4 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 5 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 6 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 7 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 8 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 9 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 10 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 11 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 12 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 13 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 14 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 15 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 16 -- + +Warning: rsort() expects parameter 2 to be long, string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 17 -- + +Warning: rsort() expects parameter 2 to be long, string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 18 -- + +Warning: rsort() expects parameter 2 to be long, string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 19 -- + +Warning: rsort() expects parameter 2 to be long, string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 20 -- + +Warning: rsort() expects parameter 2 to be long, string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 21 -- + +Warning: rsort() expects parameter 2 to be long, object given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 22 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 23 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 24 -- + +Warning: rsort() expects parameter 2 to be long, resource given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 2 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 3 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 4 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 5 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 6 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 7 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 8 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 9 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 10 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 11 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 12 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 13 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 14 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 15 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 16 -- + +Warning: rsort() expects parameter 2 to be long, Unicode string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 17 -- + +Warning: rsort() expects parameter 2 to be long, Unicode string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 18 -- + +Warning: rsort() expects parameter 2 to be long, Unicode string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 19 -- + +Warning: rsort() expects parameter 2 to be long, Unicode string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 20 -- + +Warning: rsort() expects parameter 2 to be long, Unicode string given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 21 -- + +Warning: rsort() expects parameter 2 to be long, object given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} + +-- Iteration 22 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 23 -- +bool(true) +array(5) { + [0]=> + int(5) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) + [4]=> + int(1) +} + +-- Iteration 24 -- + +Warning: rsort() expects parameter 2 to be long, resource given in %s on line %d +bool(false) +array(5) { + [0]=> + int(1) + [1]=> + int(5) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(1) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation3.phpt b/ext/standard/tests/array/rsort_variation3.phpt new file mode 100644 index 0000000000..293bec5880 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation3.phpt @@ -0,0 +1,584 @@ +--TEST-- +Test rsort() function : usage variations - numeric values +--FILE-- + SORT_REGULAR, "SORT_NUMERIC" => SORT_NUMERIC); + +$count = 1; + +// loop through to test rsort() with different arrays +foreach ($various_arrays as $array) { + echo "\n-- Iteration $count --\n"; + + echo "- With Defualt sort flag -\n"; + $temp_array = $array; + var_dump(rsort($temp_array) ); + var_dump($temp_array); + + // loop through $flag_value array and setting all possible flag values + foreach($flag_value as $key => $flag){ + echo "- Sort flag = $key -\n"; + $temp_array = $array; + var_dump(rsort($temp_array, $flag) ); + var_dump($temp_array); + } + $count++; +} + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +- With Defualt sort flag - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} + +-- Iteration 2 -- +- With Defualt sort flag - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} + +-- Iteration 3 -- +- With Defualt sort flag - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} + +-- Iteration 4 -- +- With Defualt sort flag - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +- With Defualt sort flag - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(9) { + [0]=> + int(41) + [1]=> + int(31) + [2]=> + int(21) + [3]=> + int(11) + [4]=> + int(0) + [5]=> + int(-11) + [6]=> + int(-21) + [7]=> + int(-31) + [8]=> + int(-41) +} + +-- Iteration 2 -- +- With Defualt sort flag - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(7) { + [0]=> + float(1050) + [1]=> + float(10.5) + [2]=> + float(0.5) + [3]=> + float(0.106) + [4]=> + float(0.01) + [5]=> + float(-0.1) + [6]=> + float(-10.5) +} + +-- Iteration 3 -- +- With Defualt sort flag - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(11) { + [0]=> + int(33) + [1]=> + int(2) + [2]=> + float(0.106) + [3]=> + float(0.09) + [4]=> + float(0.0021) + [5]=> + float(0.0001) + [6]=> + int(0) + [7]=> + float(-0.01) + [8]=> + float(-0.106) + [9]=> + float(-0.9) + [10]=> + int(-1) +} + +-- Iteration 4 -- +- With Defualt sort flag - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +- Sort flag = SORT_REGULAR - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +- Sort flag = SORT_NUMERIC - +bool(true) +array(7) { + [0]=> + float(2147483648) + [1]=> + int(2147483647) + [2]=> + int(0) + [3]=> + int(0) + [4]=> + int(-2147483647) + [5]=> + float(-2147483648) + [6]=> + float(-2147483649) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation4.phpt b/ext/standard/tests/array/rsort_variation4.phpt new file mode 100644 index 0000000000..be32757f10 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation4.phpt @@ -0,0 +1,116 @@ +--TEST-- +Test rsort() function : usage variations - referenced variables +--FILE-- + +--EXPECTF-- +Strict Standards: Call-time pass-by-reference has been deprecated in %s on line %d +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} + +-- 'flag' = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} + +-- 'flag' = SORT_NUMERIC -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} +Done +--UEXPECTF-- +Strict Standards: Call-time pass-by-reference has been deprecated in %s on line %d +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} + +-- 'flag' = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} + +-- 'flag' = SORT_NUMERIC -- +bool(true) +array(3) { + [0]=> + &int(555) + [1]=> + &int(100) + [2]=> + &int(33) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation5.phpt b/ext/standard/tests/array/rsort_variation5.phpt new file mode 100644 index 0000000000..9a9ec6f473 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation5.phpt @@ -0,0 +1,393 @@ +--TEST-- +Test rsort() function : usage variations - String values +--FILE-- + SORT_REGULAR, "SORT_STRING" => SORT_STRING); + +$count = 1; +// loop through to test rsort() with different arrays +foreach ($various_arrays as $array) { + echo "\n-- Iteration $count --\n"; + + echo "- With Default sort flag -\n"; + $temp_array = $array; + var_dump(rsort($temp_array) ); + var_dump($temp_array); + + // loop through $flags array and setting all possible flag values + foreach($flags as $key => $flag){ + echo "- Sort flag = $key -\n"; + + $temp_array = $array; + var_dump(rsort($temp_array, $flag) ); + var_dump($temp_array); + } + $count++; +} + +echo "Done"; +?> + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +- With Default sort flag - +bool(true) +array(11) { + [0]=> + string(4) "\xhh" + [1]=> + string(2) "\e" + [2]=> + string(4) "\ddd" + [3]=> + string(3) "\cx" + [4]=> + string(2) "\a" + [5]=> + string(1) " " + [6]=> + string(1) " " + [7]=> + string(1) " +" + [8]=> + string(1) " " + [9]=> + NULL + [10]=> + NULL +} +- Sort flag = SORT_REGULAR - +bool(true) +array(11) { + [0]=> + string(4) "\xhh" + [1]=> + string(2) "\e" + [2]=> + string(4) "\ddd" + [3]=> + string(3) "\cx" + [4]=> + string(2) "\a" + [5]=> + string(1) " " + [6]=> + string(1) " " + [7]=> + string(1) " +" + [8]=> + string(1) " " + [9]=> + NULL + [10]=> + NULL +} +- Sort flag = SORT_STRING - +bool(true) +array(11) { + [0]=> + string(4) "\xhh" + [1]=> + string(2) "\e" + [2]=> + string(4) "\ddd" + [3]=> + string(3) "\cx" + [4]=> + string(2) "\a" + [5]=> + string(1) " " + [6]=> + string(1) " " + [7]=> + string(1) " +" + [8]=> + string(1) " " + [9]=> + NULL + [10]=> + NULL +} + +-- Iteration 2 -- +- With Default sort flag - +bool(true) +array(12) { + [0]=> + string(1) "x" + [1]=> + string(2) "ww" + [2]=> + string(3) "ttt" + [3]=> + string(6) "oraNGe" + [4]=> + string(5) "lemoN" + [5]=> + string(6) "banana" + [6]=> + string(5) "apple" + [7]=> + string(1) "X" + [8]=> + string(4) "Test" + [9]=> + string(4) "TTTT" + [10]=> + string(6) "Orange" + [11]=> + string(6) "BANANA" +} +- Sort flag = SORT_REGULAR - +bool(true) +array(12) { + [0]=> + string(1) "x" + [1]=> + string(2) "ww" + [2]=> + string(3) "ttt" + [3]=> + string(6) "oraNGe" + [4]=> + string(5) "lemoN" + [5]=> + string(6) "banana" + [6]=> + string(5) "apple" + [7]=> + string(1) "X" + [8]=> + string(4) "Test" + [9]=> + string(4) "TTTT" + [10]=> + string(6) "Orange" + [11]=> + string(6) "BANANA" +} +- Sort flag = SORT_STRING - +bool(true) +array(12) { + [0]=> + string(1) "x" + [1]=> + string(2) "ww" + [2]=> + string(3) "ttt" + [3]=> + string(6) "oraNGe" + [4]=> + string(5) "lemoN" + [5]=> + string(6) "banana" + [6]=> + string(5) "apple" + [7]=> + string(1) "X" + [8]=> + string(4) "Test" + [9]=> + string(4) "TTTT" + [10]=> + string(6) "Orange" + [11]=> + string(6) "BANANA" +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +- With Default sort flag - +bool(true) +array(11) { + [0]=> + unicode(4) "\xhh" + [1]=> + unicode(2) "\e" + [2]=> + unicode(4) "\ddd" + [3]=> + unicode(3) "\cx" + [4]=> + unicode(2) "\a" + [5]=> + unicode(1) " " + [6]=> + unicode(1) " " + [7]=> + unicode(1) " +" + [8]=> + unicode(1) " " + [9]=> + NULL + [10]=> + NULL +} +- Sort flag = SORT_REGULAR - +bool(true) +array(11) { + [0]=> + unicode(4) "\xhh" + [1]=> + unicode(2) "\e" + [2]=> + unicode(4) "\ddd" + [3]=> + unicode(3) "\cx" + [4]=> + unicode(2) "\a" + [5]=> + unicode(1) " " + [6]=> + unicode(1) " " + [7]=> + unicode(1) " +" + [8]=> + unicode(1) " " + [9]=> + NULL + [10]=> + NULL +} +- Sort flag = SORT_STRING - +bool(true) +array(11) { + [0]=> + unicode(4) "\xhh" + [1]=> + unicode(2) "\e" + [2]=> + unicode(4) "\ddd" + [3]=> + unicode(3) "\cx" + [4]=> + unicode(2) "\a" + [5]=> + unicode(1) " " + [6]=> + unicode(1) " " + [7]=> + unicode(1) " +" + [8]=> + unicode(1) " " + [9]=> + NULL + [10]=> + NULL +} + +-- Iteration 2 -- +- With Default sort flag - +bool(true) +array(12) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "ww" + [2]=> + unicode(3) "ttt" + [3]=> + unicode(6) "oraNGe" + [4]=> + unicode(5) "lemoN" + [5]=> + unicode(6) "banana" + [6]=> + unicode(5) "apple" + [7]=> + unicode(1) "X" + [8]=> + unicode(4) "Test" + [9]=> + unicode(4) "TTTT" + [10]=> + unicode(6) "Orange" + [11]=> + unicode(6) "BANANA" +} +- Sort flag = SORT_REGULAR - +bool(true) +array(12) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "ww" + [2]=> + unicode(3) "ttt" + [3]=> + unicode(6) "oraNGe" + [4]=> + unicode(5) "lemoN" + [5]=> + unicode(6) "banana" + [6]=> + unicode(5) "apple" + [7]=> + unicode(1) "X" + [8]=> + unicode(4) "Test" + [9]=> + unicode(4) "TTTT" + [10]=> + unicode(6) "Orange" + [11]=> + unicode(6) "BANANA" +} +- Sort flag = SORT_STRING - +bool(true) +array(12) { + [0]=> + unicode(1) "x" + [1]=> + unicode(2) "ww" + [2]=> + unicode(3) "ttt" + [3]=> + unicode(6) "oraNGe" + [4]=> + unicode(5) "lemoN" + [5]=> + unicode(6) "banana" + [6]=> + unicode(5) "apple" + [7]=> + unicode(1) "X" + [8]=> + unicode(4) "Test" + [9]=> + unicode(4) "TTTT" + [10]=> + unicode(6) "Orange" + [11]=> + unicode(6) "BANANA" +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation6.phpt b/ext/standard/tests/array/rsort_variation6.phpt new file mode 100644 index 0000000000..42f2b1d40a --- /dev/null +++ b/ext/standard/tests/array/rsort_variation6.phpt @@ -0,0 +1,204 @@ +--TEST-- +Test rsort() function : usage variations - Hexadecimal vales +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} + +-- 'flag' value is SORT_NUMERIC -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} + +-- 'flag' value is SORT_NUMERIC -- +bool(true) +array(11) { + [0]=> + int(4095) + [1]=> + int(682) + [2]=> + int(427) + [3]=> + int(427) + [4]=> + int(255) + [5]=> + int(255) + [6]=> + int(187) + [7]=> + int(15) + [8]=> + int(0) + [9]=> + int(-255) + [10]=> + int(-682) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation7.phpt b/ext/standard/tests/array/rsort_variation7.phpt new file mode 100644 index 0000000000..ee36eb5fd9 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation7.phpt @@ -0,0 +1,151 @@ +--TEST-- +Test rsort() function : usage variations - boolean values +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_NUMERIC -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_STRING -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- 'flag' value is defualt -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_NUMERIC -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} + +-- 'flag' value is SORT_STRING -- +bool(true) +array(4) { + [0]=> + bool(true) + [1]=> + bool(true) + [2]=> + bool(false) + [3]=> + bool(false) +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation8.phpt b/ext/standard/tests/array/rsort_variation8.phpt new file mode 100644 index 0000000000..a9b53cb675 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation8.phpt @@ -0,0 +1,307 @@ +--TEST-- +Test rsort() function : usage variations - multi-dimensional arrays +--FILE-- + + +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- + +-- 'flag' value is default -- +bool(true) +array(0) { +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(0) { +} + +-- Iteration 2 -- + +-- 'flag' value is default -- +bool(true) +array(1) { + [0]=> + array(0) { + } +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(1) { + [0]=> + array(0) { + } +} + +-- Iteration 3 -- + +-- 'flag' value is default -- +bool(true) +array(3) { + [0]=> + array(2) { + [0]=> + int(64) + [1]=> + int(61) + } + [1]=> + int(44) + [2]=> + int(11) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + array(2) { + [0]=> + int(64) + [1]=> + int(61) + } + [1]=> + int(44) + [2]=> + int(11) +} + +-- Iteration 4 -- + +-- 'flag' value is default -- +bool(true) +array(4) { + [0]=> + array(3) { + [0]=> + int(33) + [1]=> + int(-5) + [2]=> + int(6) + } + [1]=> + array(2) { + [0]=> + int(22) + [1]=> + int(-55) + } + [2]=> + array(1) { + [0]=> + int(11) + } + [3]=> + array(0) { + } +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + array(3) { + [0]=> + int(33) + [1]=> + int(-5) + [2]=> + int(6) + } + [1]=> + array(2) { + [0]=> + int(22) + [1]=> + int(-55) + } + [2]=> + array(1) { + [0]=> + int(11) + } + [3]=> + array(0) { + } +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- + +-- 'flag' value is default -- +bool(true) +array(0) { +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(0) { +} + +-- Iteration 2 -- + +-- 'flag' value is default -- +bool(true) +array(1) { + [0]=> + array(0) { + } +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(1) { + [0]=> + array(0) { + } +} + +-- Iteration 3 -- + +-- 'flag' value is default -- +bool(true) +array(3) { + [0]=> + array(2) { + [0]=> + int(64) + [1]=> + int(61) + } + [1]=> + int(44) + [2]=> + int(11) +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + array(2) { + [0]=> + int(64) + [1]=> + int(61) + } + [1]=> + int(44) + [2]=> + int(11) +} + +-- Iteration 4 -- + +-- 'flag' value is default -- +bool(true) +array(4) { + [0]=> + array(3) { + [0]=> + int(33) + [1]=> + int(-5) + [2]=> + int(6) + } + [1]=> + array(2) { + [0]=> + int(22) + [1]=> + int(-55) + } + [2]=> + array(1) { + [0]=> + int(11) + } + [3]=> + array(0) { + } +} + +-- 'flag' value is SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + array(3) { + [0]=> + int(33) + [1]=> + int(-5) + [2]=> + int(6) + } + [1]=> + array(2) { + [0]=> + int(22) + [1]=> + int(-55) + } + [2]=> + array(1) { + [0]=> + int(11) + } + [3]=> + array(0) { + } +} +Done \ No newline at end of file diff --git a/ext/standard/tests/array/rsort_variation9.phpt b/ext/standard/tests/array/rsort_variation9.phpt new file mode 100644 index 0000000000..5dc7ab8ee8 --- /dev/null +++ b/ext/standard/tests/array/rsort_variation9.phpt @@ -0,0 +1,462 @@ +--TEST-- +Test rsort() function : usage variations - mixed associative arrays +--FILE-- + 55, 6 => 66, 2 => 22, 3 => 33, 1 => 11), + + // two-dimensional assoc. and default key array + array("fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), + "numbers" => array(1, 2, 3, 4, 5, 6), + "holes" => array("first", 5 => "second", "third")), + + // numeric assoc. and default key array + array(1, 1, 8 => 1, 4 => 1, 19, 3 => 13), + + // mixed assoc. array + array('bar' => 'baz', "foo" => 1), + + // assoc. only multi-dimensional array + array('a' => 1,'b' => array('e' => 2,'f' => 3),'c' => array('g' => 4),'d' => 5), +); + +$count = 1; + +// loop through to test rsort() with different arrays, +// to test the new keys for the elements in the sorted array +foreach ($various_arrays as $array) { + echo "\n-- Iteration $count --\n"; + + echo "-- Sort flag = default --\n"; + $temp_array = $array; + var_dump(rsort($temp_array) ); + var_dump($temp_array); + + echo "-- Sort flag = SORT_REGULAR --\n"; + $temp_array = $array; + var_dump(rsort($temp_array, SORT_REGULAR) ); + var_dump($temp_array); + $count++; +} + +echo "Done"; +?> +--EXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +-- Sort flag = default -- +bool(true) +array(5) { + [0]=> + int(66) + [1]=> + int(55) + [2]=> + int(33) + [3]=> + int(22) + [4]=> + int(11) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(5) { + [0]=> + int(66) + [1]=> + int(55) + [2]=> + int(33) + [3]=> + int(22) + [4]=> + int(11) +} + +-- Iteration 2 -- +-- Sort flag = default -- +bool(true) +array(3) { + [0]=> + array(6) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + } + [1]=> + array(3) { + [0]=> + string(5) "first" + [5]=> + string(6) "second" + [6]=> + string(5) "third" + } + [2]=> + array(3) { + ["a"]=> + string(6) "orange" + ["b"]=> + string(6) "banana" + ["c"]=> + string(5) "apple" + } +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + array(6) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + } + [1]=> + array(3) { + [0]=> + string(5) "first" + [5]=> + string(6) "second" + [6]=> + string(5) "third" + } + [2]=> + array(3) { + ["a"]=> + string(6) "orange" + ["b"]=> + string(6) "banana" + ["c"]=> + string(5) "apple" + } +} + +-- Iteration 3 -- +-- Sort flag = default -- +bool(true) +array(6) { + [0]=> + int(19) + [1]=> + int(13) + [2]=> + int(1) + [3]=> + int(1) + [4]=> + int(1) + [5]=> + int(1) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(6) { + [0]=> + int(19) + [1]=> + int(13) + [2]=> + int(1) + [3]=> + int(1) + [4]=> + int(1) + [5]=> + int(1) +} + +-- Iteration 4 -- +-- Sort flag = default -- +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + string(3) "baz" +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + string(3) "baz" +} + +-- Iteration 5 -- +-- Sort flag = default -- +bool(true) +array(4) { + [0]=> + array(2) { + ["e"]=> + int(2) + ["f"]=> + int(3) + } + [1]=> + array(1) { + ["g"]=> + int(4) + } + [2]=> + int(5) + [3]=> + int(1) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + array(2) { + ["e"]=> + int(2) + ["f"]=> + int(3) + } + [1]=> + array(1) { + ["g"]=> + int(4) + } + [2]=> + int(5) + [3]=> + int(1) +} +Done +--UEXPECTF-- +*** Testing rsort() : variation *** + +-- Iteration 1 -- +-- Sort flag = default -- +bool(true) +array(5) { + [0]=> + int(66) + [1]=> + int(55) + [2]=> + int(33) + [3]=> + int(22) + [4]=> + int(11) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(5) { + [0]=> + int(66) + [1]=> + int(55) + [2]=> + int(33) + [3]=> + int(22) + [4]=> + int(11) +} + +-- Iteration 2 -- +-- Sort flag = default -- +bool(true) +array(3) { + [0]=> + array(6) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + } + [1]=> + array(3) { + [0]=> + unicode(5) "first" + [5]=> + unicode(6) "second" + [6]=> + unicode(5) "third" + } + [2]=> + array(3) { + [u"a"]=> + unicode(6) "orange" + [u"b"]=> + unicode(6) "banana" + [u"c"]=> + unicode(5) "apple" + } +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(3) { + [0]=> + array(6) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + } + [1]=> + array(3) { + [0]=> + unicode(5) "first" + [5]=> + unicode(6) "second" + [6]=> + unicode(5) "third" + } + [2]=> + array(3) { + [u"a"]=> + unicode(6) "orange" + [u"b"]=> + unicode(6) "banana" + [u"c"]=> + unicode(5) "apple" + } +} + +-- Iteration 3 -- +-- Sort flag = default -- +bool(true) +array(6) { + [0]=> + int(19) + [1]=> + int(13) + [2]=> + int(1) + [3]=> + int(1) + [4]=> + int(1) + [5]=> + int(1) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(6) { + [0]=> + int(19) + [1]=> + int(13) + [2]=> + int(1) + [3]=> + int(1) + [4]=> + int(1) + [5]=> + int(1) +} + +-- Iteration 4 -- +-- Sort flag = default -- +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + unicode(3) "baz" +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(2) { + [0]=> + int(1) + [1]=> + unicode(3) "baz" +} + +-- Iteration 5 -- +-- Sort flag = default -- +bool(true) +array(4) { + [0]=> + array(2) { + [u"e"]=> + int(2) + [u"f"]=> + int(3) + } + [1]=> + array(1) { + [u"g"]=> + int(4) + } + [2]=> + int(5) + [3]=> + int(1) +} +-- Sort flag = SORT_REGULAR -- +bool(true) +array(4) { + [0]=> + array(2) { + [u"e"]=> + int(2) + [u"f"]=> + int(3) + } + [1]=> + array(1) { + [u"g"]=> + int(4) + } + [2]=> + int(5) + [3]=> + int(1) +} +Done \ No newline at end of file -- 2.40.0