xref: /PHP-7.4/ext/standard/tests/array/bug54459.phpt (revision 840308cf)
1--TEST--
2Bug #54459 (Range function accuracy)
3--INI--
4precision=14
5--FILE--
6<?php
7foreach (range(90, 100, .1) as $i => $v){
8  echo $i, ' = ', $v, PHP_EOL;
9}
10foreach (range("90", "100", .1) as $i => $v){
11  echo $i, ' = ', $v, PHP_EOL;
12}
13--EXPECT--
140 = 90
151 = 90.1
162 = 90.2
173 = 90.3
184 = 90.4
195 = 90.5
206 = 90.6
217 = 90.7
228 = 90.8
239 = 90.9
2410 = 91
2511 = 91.1
2612 = 91.2
2713 = 91.3
2814 = 91.4
2915 = 91.5
3016 = 91.6
3117 = 91.7
3218 = 91.8
3319 = 91.9
3420 = 92
3521 = 92.1
3622 = 92.2
3723 = 92.3
3824 = 92.4
3925 = 92.5
4026 = 92.6
4127 = 92.7
4228 = 92.8
4329 = 92.9
4430 = 93
4531 = 93.1
4632 = 93.2
4733 = 93.3
4834 = 93.4
4935 = 93.5
5036 = 93.6
5137 = 93.7
5238 = 93.8
5339 = 93.9
5440 = 94
5541 = 94.1
5642 = 94.2
5743 = 94.3
5844 = 94.4
5945 = 94.5
6046 = 94.6
6147 = 94.7
6248 = 94.8
6349 = 94.9
6450 = 95
6551 = 95.1
6652 = 95.2
6753 = 95.3
6854 = 95.4
6955 = 95.5
7056 = 95.6
7157 = 95.7
7258 = 95.8
7359 = 95.9
7460 = 96
7561 = 96.1
7662 = 96.2
7763 = 96.3
7864 = 96.4
7965 = 96.5
8066 = 96.6
8167 = 96.7
8268 = 96.8
8369 = 96.9
8470 = 97
8571 = 97.1
8672 = 97.2
8773 = 97.3
8874 = 97.4
8975 = 97.5
9076 = 97.6
9177 = 97.7
9278 = 97.8
9379 = 97.9
9480 = 98
9581 = 98.1
9682 = 98.2
9783 = 98.3
9884 = 98.4
9985 = 98.5
10086 = 98.6
10187 = 98.7
10288 = 98.8
10389 = 98.9
10490 = 99
10591 = 99.1
10692 = 99.2
10793 = 99.3
10894 = 99.4
10995 = 99.5
11096 = 99.6
11197 = 99.7
11298 = 99.8
11399 = 99.9
114100 = 100
1150 = 90
1161 = 90.1
1172 = 90.2
1183 = 90.3
1194 = 90.4
1205 = 90.5
1216 = 90.6
1227 = 90.7
1238 = 90.8
1249 = 90.9
12510 = 91
12611 = 91.1
12712 = 91.2
12813 = 91.3
12914 = 91.4
13015 = 91.5
13116 = 91.6
13217 = 91.7
13318 = 91.8
13419 = 91.9
13520 = 92
13621 = 92.1
13722 = 92.2
13823 = 92.3
13924 = 92.4
14025 = 92.5
14126 = 92.6
14227 = 92.7
14328 = 92.8
14429 = 92.9
14530 = 93
14631 = 93.1
14732 = 93.2
14833 = 93.3
14934 = 93.4
15035 = 93.5
15136 = 93.6
15237 = 93.7
15338 = 93.8
15439 = 93.9
15540 = 94
15641 = 94.1
15742 = 94.2
15843 = 94.3
15944 = 94.4
16045 = 94.5
16146 = 94.6
16247 = 94.7
16348 = 94.8
16449 = 94.9
16550 = 95
16651 = 95.1
16752 = 95.2
16853 = 95.3
16954 = 95.4
17055 = 95.5
17156 = 95.6
17257 = 95.7
17358 = 95.8
17459 = 95.9
17560 = 96
17661 = 96.1
17762 = 96.2
17863 = 96.3
17964 = 96.4
18065 = 96.5
18166 = 96.6
18267 = 96.7
18368 = 96.8
18469 = 96.9
18570 = 97
18671 = 97.1
18772 = 97.2
18873 = 97.3
18974 = 97.4
19075 = 97.5
19176 = 97.6
19277 = 97.7
19378 = 97.8
19479 = 97.9
19580 = 98
19681 = 98.1
19782 = 98.2
19883 = 98.3
19984 = 98.4
20085 = 98.5
20186 = 98.6
20287 = 98.7
20388 = 98.8
20489 = 98.9
20590 = 99
20691 = 99.1
20792 = 99.2
20893 = 99.3
20994 = 99.4
21095 = 99.5
21196 = 99.6
21297 = 99.7
21398 = 99.8
21499 = 99.9
215100 = 100
216