File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -2924,8 +2924,8 @@ PHP_FUNCTION(range)
2924
2924
2925
2925
/* If the range is given as strings, generate an array of characters. */
2926
2926
if (start_type >= IS_STRING || end_type >= IS_STRING ) {
2927
- /* If one of the inputs is NOT a string */
2928
- if (UNEXPECTED (start_type + end_type < 2 * IS_STRING )) {
2927
+ /* If one of the inputs is NOT a string nor single-byte string */
2928
+ if (UNEXPECTED (start_type < IS_STRING || end_type < IS_STRING )) {
2929
2929
if (start_type < IS_STRING ) {
2930
2930
if (end_type != IS_ARRAY ) {
2931
2931
php_error_docref (NULL , E_WARNING , "Argument #1 ($start) must be a single byte string if"
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-13094 (range(9.9, '0') causes segmentation fault)
3
+ --FILE--
4
+ <?php
5
+ var_dump (range (9.9 , '0 ' ));
6
+ ?>
7
+ --EXPECT--
8
+ array(10) {
9
+ [0]=>
10
+ float(9.9)
11
+ [1]=>
12
+ float(8.9)
13
+ [2]=>
14
+ float(7.9)
15
+ [3]=>
16
+ float(6.9)
17
+ [4]=>
18
+ float(5.9)
19
+ [5]=>
20
+ float(4.9)
21
+ [6]=>
22
+ float(3.9000000000000004)
23
+ [7]=>
24
+ float(2.9000000000000004)
25
+ [8]=>
26
+ float(1.9000000000000004)
27
+ [9]=>
28
+ float(0.9000000000000004)
29
+ }
You can’t perform that action at this time.
0 commit comments