Skip to content

Commit 9b0df97

Browse files
committed
Fix handling of void return type on internal functions
1 parent 2eb6a54 commit 9b0df97

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Zend/zend_execute.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,12 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
10421042
zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
10431043
zend_class_entry *ce = NULL;
10441044

1045-
if (UNEXPECTED(ret_info->type_hint == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
1046-
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
1047-
return 0;
1045+
if (ret_info->type_hint == IS_VOID) {
1046+
if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) {
1047+
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
1048+
return 0;
1049+
}
1050+
return 1;
10481051
}
10491052

10501053
if (UNEXPECTED(!zend_check_internal_type(zf, ret_info, ret, &ce, 1))) {

0 commit comments

Comments
 (0)