We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d9f979 commit 5185d46Copy full SHA for 5185d46
ext/standard/array.c
@@ -3049,9 +3049,9 @@ PHP_FUNCTION(range)
3049
goto handle_numeric_inputs;
3050
}
3051
3052
- /* Generate array of characters, as ints to make bounds checking possible in the loop condition */
3053
- int low = Z_STRVAL_P(user_start)[0];
3054
- int high = Z_STRVAL_P(user_end)[0];
+ /* Generate array of characters, as zero-extended ints to make bounds checking possible in the loop condition */
+ int low = (unsigned char) Z_STRVAL_P(user_start)[0];
+ int high = (unsigned char) Z_STRVAL_P(user_end)[0];
3055
3056
/* Decreasing char range */
3057
if (low > high) {
0 commit comments