@@ -1607,7 +1607,7 @@ static zend_always_inline void _object_properties_init(zend_object *object, zend
1607
1607
if (class_type -> default_properties_count ) {
1608
1608
zval * src = CE_DEFAULT_PROPERTIES_TABLE (class_type );
1609
1609
zval * dst = object -> properties_table ;
1610
- #if 1
1610
+ #if 0
1611
1611
zval * end = src + class_type -> default_properties_count ;
1612
1612
if (UNEXPECTED (class_type -> type == ZEND_INTERNAL_CLASS )) {
1613
1613
// do {
@@ -1634,7 +1634,13 @@ static zend_always_inline void _object_properties_init(zend_object *object, zend
1634
1634
} else {
1635
1635
// TODO: assertion?
1636
1636
/* zend_declare_typed_property() disallows refcounted default property values in internal classes */
1637
- memcpy (dst , src , sizeof (zval ) * class_type -> default_properties_count );
1637
+ // memcpy(dst, src, sizeof(zval) * class_type->default_properties_count);
1638
+ zval * end = src + class_type -> default_properties_count ;
1639
+ do {
1640
+ ZVAL_COPY_VALUE_PROP (dst , src );
1641
+ src ++ ;
1642
+ dst ++ ;
1643
+ } while (src != end );
1638
1644
}
1639
1645
#endif
1640
1646
}
@@ -4395,9 +4401,9 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z
4395
4401
}
4396
4402
}
4397
4403
// printf("%s %s\n", ce->name->val, name->val);
4398
- // if (Z_REFCOUNTED_P(property)) {
4399
- // ce->ce_flags |= ZEND_ACC_HAS_RC_PROPS;
4400
- // }
4404
+ if (Z_REFCOUNTED_P (property )) {
4405
+ ce -> ce_flags |= ZEND_ACC_HAS_RC_PROPS ;
4406
+ }
4401
4407
property_default_ptr = & ce -> default_properties_table [OBJ_PROP_TO_NUM (property_info -> offset )];
4402
4408
ZVAL_COPY_VALUE (property_default_ptr , property );
4403
4409
Z_PROP_FLAG_P (property_default_ptr ) = Z_ISUNDEF_P (property ) ? IS_PROP_UNINIT : 0 ;
0 commit comments