1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Use zend_string_init_fast() for single-character string creation (#21438)

This commit is contained in:
Arshid
2026-03-14 15:20:21 +05:30
committed by GitHub
parent 31962aa086
commit a5ffcf3b1a

View File

@@ -402,7 +402,7 @@ static inline zend_result ct_eval_fetch_dim(zval *result, zval *op1, zval *op2,
return FAILURE;
}
if (index >= 0 && index < Z_STRLEN_P(op1)) {
ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0));
ZVAL_CHAR(result, Z_STRVAL_P(op1)[index]);
return SUCCESS;
}
}