Skip to content

Commit 745bc4c

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79849
2 parents 70501b8 + 162776a commit 745bc4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/standard/string.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,8 +2570,9 @@ PHP_FUNCTION(chr)
25702570
Uppercase the first character of the word in a native string */
25712571
static zend_string* php_ucfirst(zend_string *str)
25722572
{
2573-
unsigned char r = toupper(ZSTR_VAL(str)[0]);
2574-
if (r == ZSTR_VAL(str)[0]) {
2573+
const unsigned char ch = ZSTR_VAL(str)[0];
2574+
unsigned char r = toupper(ch);
2575+
if (r == ch) {
25752576
return zend_string_copy(str);
25762577
} else {
25772578
zend_string *s = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 0);

0 commit comments

Comments
 (0)