Skip to content

Commit ffdf089

Browse files
committed
more of the same
1 parent 14f21a8 commit ffdf089

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

Zend/zend_API.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -525,27 +525,21 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32
525525

526526
ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, uint32_t arg_num) /* {{{ */
527527
{
528-
zend_opt_bool result;
529528
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
530529
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) {
531-
result.has_value = false;
532-
return result;
530+
return (zend_opt_bool){false, false};
533531
}
534-
result.value = zend_is_true(arg);
535-
result.has_value = true;
532+
return (zend_opt_bool){zend_is_true(arg), true};
536533
} else {
537-
result.has_value = false;
534+
return (zend_opt_bool){false, false};
538535
}
539-
return result;
540536
}
541537
/* }}} */
542538

543539
ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, uint32_t arg_num) /* {{{ */
544540
{
545541
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
546-
zend_opt_bool result;
547-
result.has_value = false;
548-
return result;
542+
return (zend_opt_bool){false, false};
549543
}
550544
return zend_parse_arg_bool_weak(arg, arg_num);
551545
}
@@ -554,9 +548,7 @@ ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, u
554548
ZEND_API zend_opt_bool ZEND_FASTCALL zend_flf_parse_arg_bool_slow(const zval *arg, uint32_t arg_num)
555549
{
556550
if (UNEXPECTED(ZEND_FLF_ARG_USES_STRICT_TYPES())) {
557-
zend_opt_bool result;
558-
result.has_value = false;
559-
return result;
551+
return (zend_opt_bool){false, false};
560552
}
561553
return zend_parse_arg_bool_weak(arg, arg_num);
562554
}
@@ -703,10 +695,7 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_slow(const zval *ar
703695
{
704696
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
705697
/* SSTH Exception: IS_LONG may be accepted instead as IS_DOUBLE */
706-
zend_opt_double result;
707-
result.has_value = true;
708-
result.value = (double)Z_LVAL_P(arg);
709-
return result;
698+
return (zend_opt_double){(double)Z_LVAL_P(arg), true};
710699
} else if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
711700
zend_opt_double result;
712701
result.has_value = false;

0 commit comments

Comments
 (0)