1--TEST--
2range(): float boundary inputs
3--INI--
4serialize_precision=14
5--FILE--
6<?php
7echo "Increasing Range\n";
8var_dump( range(1.5, 6.5) );
9
10echo "\nDecreasing range\n";
11var_dump( range(6.5, 1.5) );
12
13echo "\nBoundaries are equal\n";
14var_dump( range(5.5, 5.5) );
15
16echo "\nPassing int step\n";
17var_dump( range(1.5, 10.5, 3) );
18var_dump( range(10.5, 1.5, 3) );
19var_dump( range(1.5, 10.5, "3") );
20
21echo "\nPassing float step\n";
22var_dump( range(1.6, 2.2, 0.1) );
23var_dump( range(2.2, 1.6, 0.1) );
24var_dump( range(1.6, 2.2, "0.1") );
25
26echo "Done\n";
27?>
28--EXPECT--
29Increasing Range
30array(6) {
31  [0]=>
32  float(1.5)
33  [1]=>
34  float(2.5)
35  [2]=>
36  float(3.5)
37  [3]=>
38  float(4.5)
39  [4]=>
40  float(5.5)
41  [5]=>
42  float(6.5)
43}
44
45Decreasing range
46array(6) {
47  [0]=>
48  float(6.5)
49  [1]=>
50  float(5.5)
51  [2]=>
52  float(4.5)
53  [3]=>
54  float(3.5)
55  [4]=>
56  float(2.5)
57  [5]=>
58  float(1.5)
59}
60
61Boundaries are equal
62array(1) {
63  [0]=>
64  float(5.5)
65}
66
67Passing int step
68array(4) {
69  [0]=>
70  float(1.5)
71  [1]=>
72  float(4.5)
73  [2]=>
74  float(7.5)
75  [3]=>
76  float(10.5)
77}
78array(4) {
79  [0]=>
80  float(10.5)
81  [1]=>
82  float(7.5)
83  [2]=>
84  float(4.5)
85  [3]=>
86  float(1.5)
87}
88array(4) {
89  [0]=>
90  float(1.5)
91  [1]=>
92  float(4.5)
93  [2]=>
94  float(7.5)
95  [3]=>
96  float(10.5)
97}
98
99Passing float step
100array(7) {
101  [0]=>
102  float(1.6)
103  [1]=>
104  float(1.7)
105  [2]=>
106  float(1.8)
107  [3]=>
108  float(1.9)
109  [4]=>
110  float(2)
111  [5]=>
112  float(2.1)
113  [6]=>
114  float(2.2)
115}
116array(7) {
117  [0]=>
118  float(2.2)
119  [1]=>
120  float(2.1)
121  [2]=>
122  float(2)
123  [3]=>
124  float(1.9)
125  [4]=>
126  float(1.8)
127  [5]=>
128  float(1.7)
129  [6]=>
130  float(1.6)
131}
132array(7) {
133  [0]=>
134  float(1.6)
135  [1]=>
136  float(1.7)
137  [2]=>
138  float(1.8)
139  [3]=>
140  float(1.9)
141  [4]=>
142  float(2)
143  [5]=>
144  float(2.1)
145  [6]=>
146  float(2.2)
147}
148Done
149