Skip to content

Commit a5ffcf3

Browse files
authored
Use zend_string_init_fast() for single-character string creation (php#21438)
1 parent 31962aa commit a5ffcf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/Optimizer/sccp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static inline zend_result ct_eval_fetch_dim(zval *result, zval *op1, zval *op2,
402402
return FAILURE;
403403
}
404404
if (index >= 0 && index < Z_STRLEN_P(op1)) {
405-
ZVAL_STR(result, zend_string_init(&Z_STRVAL_P(op1)[index], 1, 0));
405+
ZVAL_CHAR(result, Z_STRVAL_P(op1)[index]);
406406
return SUCCESS;
407407
}
408408
}

0 commit comments

Comments
 (0)