summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaszi <haszika80@gmail.com>2020-12-27 17:03:41 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-12-27 18:30:58 +0100
commit0db6f5267cc819b230bac6c4df87779347a70978 (patch)
tree059b90aab5f59103e70cfc364d42fa892077304c
parent70dfbe00684eb1c31d5b49f643e4736696c3b7df (diff)
downloadphp-git-0db6f5267cc819b230bac6c4df87779347a70978.tar.gz
Replace sort() function calls with ksort() in basic ksort test
Closes GH-6541.
-rw-r--r--ext/standard/tests/array/ksort_basic.phpt54
1 files changed, 27 insertions, 27 deletions
diff --git a/ext/standard/tests/array/ksort_basic.phpt b/ext/standard/tests/array/ksort_basic.phpt
index ff0469e7a3..cf9af16da8 100644
--- a/ext/standard/tests/array/ksort_basic.phpt
+++ b/ext/standard/tests/array/ksort_basic.phpt
@@ -53,17 +53,17 @@ var_dump( $temp_array);
echo "\n-- Testing ksort() by supplying string array (case insensitive), 'flag' = SORT_STRING|SORT_FLAG_CASE --\n";
$temp_array = $unsorted_strings;
-var_dump( sort($temp_array, SORT_STRING|SORT_FLAG_CASE) ); // expecting : bool(true)
+var_dump( ksort($temp_array, SORT_STRING|SORT_FLAG_CASE) ); // expecting : bool(true)
var_dump( $temp_array);
echo "\n-- Testing ksort() by supplying string array (natural), 'flag' = SORT_NATURAL --\n";
$temp_array = $unsorted_strings;
-var_dump( sort($temp_array, SORT_NATURAL) ); // expecting : bool(true)
+var_dump( ksort($temp_array, SORT_NATURAL) ); // expecting : bool(true)
var_dump( $temp_array);
echo "\n-- Testing ksort() by supplying string array (natural, case insensitive), 'flag' = SORT_NATURAL|SORT_FLAG_CASE --\n";
$temp_array = $unsorted_strings;
-var_dump( sort($temp_array, SORT_NATURAL|SORT_FLAG_CASE) ); // expecting : bool(true)
+var_dump( ksort($temp_array, SORT_NATURAL|SORT_FLAG_CASE) ); // expecting : bool(true)
var_dump( $temp_array);
echo "\n-- Testing ksort() by supplying numeric array, 'flag' = SORT_NUMERIC --\n";
@@ -168,63 +168,63 @@ array(8) {
-- Testing ksort() by supplying string array (case insensitive), 'flag' = SORT_STRING|SORT_FLAG_CASE --
bool(true)
array(8) {
- [0]=>
+ ["b"]=>
string(6) "banana"
- [1]=>
+ ["l"]=>
string(5) "lemon"
- [2]=>
+ ["o"]=>
string(6) "orange"
- [3]=>
+ ["O"]=>
string(6) "Orange"
- [4]=>
+ ["O1"]=>
string(7) "Orange1"
- [5]=>
+ ["o2"]=>
string(7) "orange2"
- [6]=>
+ ["o20"]=>
string(8) "orange20"
- [7]=>
+ ["O3"]=>
string(7) "Orange3"
}
-- Testing ksort() by supplying string array (natural), 'flag' = SORT_NATURAL --
bool(true)
array(8) {
- [0]=>
+ ["O"]=>
string(6) "Orange"
- [1]=>
+ ["O1"]=>
string(7) "Orange1"
- [2]=>
+ ["O3"]=>
string(7) "Orange3"
- [3]=>
+ ["b"]=>
string(6) "banana"
- [4]=>
+ ["l"]=>
string(5) "lemon"
- [5]=>
+ ["o"]=>
string(6) "orange"
- [6]=>
+ ["o2"]=>
string(7) "orange2"
- [7]=>
+ ["o20"]=>
string(8) "orange20"
}
-- Testing ksort() by supplying string array (natural, case insensitive), 'flag' = SORT_NATURAL|SORT_FLAG_CASE --
bool(true)
array(8) {
- [0]=>
+ ["b"]=>
string(6) "banana"
- [1]=>
+ ["l"]=>
string(5) "lemon"
- [2]=>
+ ["o"]=>
string(6) "orange"
- [3]=>
+ ["O"]=>
string(6) "Orange"
- [4]=>
+ ["O1"]=>
string(7) "Orange1"
- [5]=>
+ ["o2"]=>
string(7) "orange2"
- [6]=>
+ ["O3"]=>
string(7) "Orange3"
- [7]=>
+ ["o20"]=>
string(8) "orange20"
}