Skip to content

Commit f0c4b16

Browse files
committed
Improve error message about step parameter being out of range
1 parent 1a16008 commit f0c4b16

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/standard/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2941,7 +2941,7 @@ PHP_FUNCTION(range)
29412941
}
29422942
err:
29432943
if (err) {
2944-
zend_argument_value_error(3, "must not exceed the specified range");
2944+
zend_argument_value_error(3, "must be less than the range spanned by argument #1 ($start) and argument #2 ($end)");
29452945
RETURN_THROWS();
29462946
}
29472947
}

ext/standard/tests/array/range/range_step_errors.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ range(): Argument #3 ($step) must be a finite number, NAN provided
104104
range(): Argument #3 ($step) must be a finite number, NAN provided
105105
Step must be within the range of input parameters
106106
-- Testing ( (low < high) && (high-low < step) ) --
107-
range(): Argument #3 ($step) must not exceed the specified range
107+
range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
108108
-- Testing ( (low > high) && (low-high < step) ) --
109-
range(): Argument #3 ($step) must not exceed the specified range
109+
range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
110110
-- Testing ( (low < high) && (high-low < step) ) for characters --
111-
range(): Argument #3 ($step) must not exceed the specified range
111+
range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)
112112
-- Testing ( (low > high) && (low-high < step) ) for characters --
113-
range(): Argument #3 ($step) must not exceed the specified range
113+
range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)

0 commit comments

Comments
 (0)