1--TEST--
2Test range() function with basic/expected string inputs
3--INI--
4serialize_precision=14
5--FILE--
6<?php
7
8echo "-- Chars as Low and High --\n";
9echo "-- An array of elements from low to high --\n";
10var_dump( range("a", "z") );
11echo "\n-- An array of elements from high to low --\n";
12var_dump( range("z", "a") );
13
14echo "\n-- Low and High are equal --\n";
15var_dump( range("q", "q") );
16
17echo "\n-- Testing basic string with step --\n";
18var_dump( range("a", "h", 2) );
19
20echo "Done\n";
21?>
22--EXPECT--
23-- Chars as Low and High --
24-- An array of elements from low to high --
25array(26) {
26  [0]=>
27  string(1) "a"
28  [1]=>
29  string(1) "b"
30  [2]=>
31  string(1) "c"
32  [3]=>
33  string(1) "d"
34  [4]=>
35  string(1) "e"
36  [5]=>
37  string(1) "f"
38  [6]=>
39  string(1) "g"
40  [7]=>
41  string(1) "h"
42  [8]=>
43  string(1) "i"
44  [9]=>
45  string(1) "j"
46  [10]=>
47  string(1) "k"
48  [11]=>
49  string(1) "l"
50  [12]=>
51  string(1) "m"
52  [13]=>
53  string(1) "n"
54  [14]=>
55  string(1) "o"
56  [15]=>
57  string(1) "p"
58  [16]=>
59  string(1) "q"
60  [17]=>
61  string(1) "r"
62  [18]=>
63  string(1) "s"
64  [19]=>
65  string(1) "t"
66  [20]=>
67  string(1) "u"
68  [21]=>
69  string(1) "v"
70  [22]=>
71  string(1) "w"
72  [23]=>
73  string(1) "x"
74  [24]=>
75  string(1) "y"
76  [25]=>
77  string(1) "z"
78}
79
80-- An array of elements from high to low --
81array(26) {
82  [0]=>
83  string(1) "z"
84  [1]=>
85  string(1) "y"
86  [2]=>
87  string(1) "x"
88  [3]=>
89  string(1) "w"
90  [4]=>
91  string(1) "v"
92  [5]=>
93  string(1) "u"
94  [6]=>
95  string(1) "t"
96  [7]=>
97  string(1) "s"
98  [8]=>
99  string(1) "r"
100  [9]=>
101  string(1) "q"
102  [10]=>
103  string(1) "p"
104  [11]=>
105  string(1) "o"
106  [12]=>
107  string(1) "n"
108  [13]=>
109  string(1) "m"
110  [14]=>
111  string(1) "l"
112  [15]=>
113  string(1) "k"
114  [16]=>
115  string(1) "j"
116  [17]=>
117  string(1) "i"
118  [18]=>
119  string(1) "h"
120  [19]=>
121  string(1) "g"
122  [20]=>
123  string(1) "f"
124  [21]=>
125  string(1) "e"
126  [22]=>
127  string(1) "d"
128  [23]=>
129  string(1) "c"
130  [24]=>
131  string(1) "b"
132  [25]=>
133  string(1) "a"
134}
135
136-- Low and High are equal --
137array(1) {
138  [0]=>
139  string(1) "q"
140}
141
142-- Testing basic string with step --
143array(4) {
144  [0]=>
145  string(1) "a"
146  [1]=>
147  string(1) "c"
148  [2]=>
149  string(1) "e"
150  [3]=>
151  string(1) "g"
152}
153Done
154