Skip to content

Commit f5e072d

Browse files
committed
revert code sandwich
1 parent 8b62674 commit f5e072d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Zend/zend_API.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,13 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32
511511

512512
ZEND_API zpp_parse_bool_status ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, uint32_t arg_num) /* {{{ */
513513
{
514-
if (UNEXPECTED(Z_TYPE_P(arg) > IS_STRING)) {
515-
return ZPP_PARSE_BOOL_STATUS_ERROR;
516-
}
517-
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) {
518-
return ZPP_PARSE_BOOL_STATUS_ERROR;
514+
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
515+
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) {
516+
return ZPP_PARSE_BOOL_STATUS_ERROR;
517+
}
518+
return zend_is_true(arg);
519519
}
520-
return zend_is_true(arg);
520+
return ZPP_PARSE_BOOL_STATUS_ERROR;
521521
}
522522
/* }}} */
523523

0 commit comments

Comments
 (0)