Skip to content

Commit 5811e86

Browse files
committed
Don't mess NULL and UNDEF default value back and force. Set proper value in first place.
1 parent 6bb1fa9 commit 5811e86

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Zend/zend_API.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3655,10 +3655,6 @@ ZEND_API int zend_declare_typed_property(zend_class_entry *ce, zend_string *name
36553655
}
36563656
}
36573657

3658-
if (Z_ISUNDEF_P(property) && (!optional_type || allow_null)) {
3659-
ZVAL_NULL(property);
3660-
}
3661-
36623658
if (!(access_type & ZEND_ACC_PPP_MASK)) {
36633659
access_type |= ZEND_ACC_PUBLIC;
36643660
}

Zend/zend_compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5615,6 +5615,8 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast) /* {{{ */
56155615
zend_get_type_by_const(optional_type));
56165616
}
56175617
}
5618+
} else if (!optional_type || allow_null) {
5619+
ZVAL_NULL(&value_zv);
56185620
} else {
56195621
ZVAL_UNDEF(&value_zv);
56205622
}

0 commit comments

Comments
 (0)