Skip to content

Commit 815544f

Browse files
committed
Use is_numeric_str_function() more often
1 parent a3d805e commit 815544f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static zend_bool zend_verify_weak_scalar_type_hint(uint32_t type_mask, zval *arg
728728
/* For an int|float union type and string value,
729729
* determine chosen type by is_numeric_string() semantics. */
730730
if ((type_mask & MAY_BE_DOUBLE) && Z_TYPE_P(arg) == IS_STRING) {
731-
zend_uchar type = is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, false);
731+
zend_uchar type = is_numeric_str_function(Z_STR_P(arg), &lval, &dval);
732732
if (type == IS_LONG) {
733733
zend_string_release(Z_STR_P(arg));
734734
ZVAL_LONG(arg, lval);

Zend/zend_operators.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ ZEND_API int ZEND_FASTCALL increment_function(zval *op1) /* {{{ */
24172417
zend_long lval;
24182418
double dval;
24192419

2420-
switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, false)) {
2420+
switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) {
24212421
case IS_LONG:
24222422
zval_ptr_dtor_str(op1);
24232423
if (lval == ZEND_LONG_MAX) {
@@ -2484,7 +2484,7 @@ ZEND_API int ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */
24842484
ZVAL_LONG(op1, -1);
24852485
break;
24862486
}
2487-
switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, false)) {
2487+
switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) {
24882488
case IS_LONG:
24892489
zval_ptr_dtor_str(op1);
24902490
if (lval == ZEND_LONG_MIN) {

0 commit comments

Comments
 (0)