@@ -525,27 +525,21 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32
525
525
526
526
ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_weak (const zval * arg , uint32_t arg_num ) /* {{{ */
527
527
{
528
- zend_opt_bool result ;
529
528
if (EXPECTED (Z_TYPE_P (arg ) <= IS_STRING )) {
530
529
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};
533
531
}
534
- result .value = zend_is_true (arg );
535
- result .has_value = true;
532
+ return (zend_opt_bool ){zend_is_true (arg ), true};
536
533
} else {
537
- result . has_value = false;
534
+ return ( zend_opt_bool ){false, false} ;
538
535
}
539
- return result ;
540
536
}
541
537
/* }}} */
542
538
543
539
ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_slow (const zval * arg , uint32_t arg_num ) /* {{{ */
544
540
{
545
541
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};
549
543
}
550
544
return zend_parse_arg_bool_weak (arg , arg_num );
551
545
}
@@ -554,9 +548,7 @@ ZEND_API zend_opt_bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, u
554
548
ZEND_API zend_opt_bool ZEND_FASTCALL zend_flf_parse_arg_bool_slow (const zval * arg , uint32_t arg_num )
555
549
{
556
550
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};
560
552
}
561
553
return zend_parse_arg_bool_weak (arg , arg_num );
562
554
}
@@ -703,10 +695,7 @@ ZEND_API zend_opt_double ZEND_FASTCALL zend_parse_arg_double_slow(const zval *ar
703
695
{
704
696
if (EXPECTED (Z_TYPE_P (arg ) == IS_LONG )) {
705
697
/* 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};
710
699
} else if (UNEXPECTED (ZEND_ARG_USES_STRICT_TYPES ())) {
711
700
zend_opt_double result ;
712
701
result .has_value = false;
0 commit comments