1--TEST--
2Test natcasesort() function : usage variations - different string types
3--FILE--
4<?php
5/*
6 * Pass arrays of string data to see how natcasesort() re-orders the array
7 */
8
9echo "*** Testing natcasesort() : usage variation ***\n";
10
11$inputs = array (
12    // group of escape sequences
13    array(null, NULL, "\a", "\cx", "\e", "\f", "\n", "\t", "\xhh", "\ddd", "\v"),
14
15    // array contains combination of capital/small letters
16    array("lemoN", "Orange", "banana", "apple", "Test", "TTTT", "ttt", "ww", "x", "X", "oraNGe", "BANANA")
17);
18
19foreach ($inputs as $array_arg) {
20    var_dump( natcasesort($array_arg) );
21    var_dump($array_arg);
22}
23
24echo "Done";
25?>
26--EXPECT--
27*** Testing natcasesort() : usage variation ***
28bool(true)
29array(11) {
30  [0]=>
31  NULL
32  [1]=>
33  NULL
34  [5]=>
35  string(1) ""
36  [6]=>
37  string(1) "
38"
39  [7]=>
40  string(1) "	"
41  [10]=>
42  string(1) ""
43  [4]=>
44  string(1) ""
45  [2]=>
46  string(2) "\a"
47  [3]=>
48  string(3) "\cx"
49  [9]=>
50  string(4) "\ddd"
51  [8]=>
52  string(4) "\xhh"
53}
54bool(true)
55array(12) {
56  [3]=>
57  string(5) "apple"
58  [2]=>
59  string(6) "banana"
60  [11]=>
61  string(6) "BANANA"
62  [0]=>
63  string(5) "lemoN"
64  [1]=>
65  string(6) "Orange"
66  [10]=>
67  string(6) "oraNGe"
68  [4]=>
69  string(4) "Test"
70  [6]=>
71  string(3) "ttt"
72  [5]=>
73  string(4) "TTTT"
74  [7]=>
75  string(2) "ww"
76  [8]=>
77  string(1) "x"
78  [9]=>
79  string(1) "X"
80}
81Done
82