@@ -1586,28 +1586,6 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
1586
1586
}
1587
1587
/* }}} */
1588
1588
1589
- ZEND_API zend_never_inline void zend_forbidden_dynamic_property (zend_class_entry * ce , zend_string * member ) {
1590
- zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
1591
- ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
1592
- }
1593
-
1594
- ZEND_API zend_never_inline bool zend_deprecated_dynamic_property (zend_object * obj , zend_string * member ) {
1595
- GC_ADDREF (obj );
1596
- zend_error (E_DEPRECATED , "Creation of dynamic property %s::$%s is deprecated" ,
1597
- ZSTR_VAL (obj -> ce -> name ), ZSTR_VAL (member ));
1598
- if (UNEXPECTED (GC_DELREF (obj ) == 0 )) {
1599
- zend_class_entry * ce = obj -> ce ;
1600
- zend_objects_store_del (obj );
1601
- if (!EG (exception )) {
1602
- /* We cannot continue execution and have to throw an exception */
1603
- zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
1604
- ZSTR_VAL (ce -> name ), ZSTR_VAL (member ));
1605
- }
1606
- return 0 ;
1607
- }
1608
- return 1 ;
1609
- }
1610
-
1611
1589
ZEND_API void object_properties_load (zend_object * object , HashTable * properties ) /* {{{ */
1612
1590
{
1613
1591
zval * prop , tmp ;
@@ -1650,12 +1628,12 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
1650
1628
}
1651
1629
} else {
1652
1630
if (UNEXPECTED (object -> ce -> ce_flags & ZEND_ACC_NO_DYNAMIC_PROPERTIES )) {
1653
- zend_forbidden_dynamic_property (object -> ce , key );
1631
+ zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
1632
+ ZSTR_VAL (object -> ce -> name ), zend_get_unmangled_property_name (key ));
1654
1633
return ;
1655
1634
} else if (!(object -> ce -> ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES )) {
1656
- if (!zend_deprecated_dynamic_property (object , key )) {
1657
- return ;
1658
- }
1635
+ zend_error (E_DEPRECATED , "Creation of dynamic property %s::$%s is deprecated" ,
1636
+ ZSTR_VAL (object -> ce -> name ), zend_get_unmangled_property_name (key ));
1659
1637
}
1660
1638
1661
1639
if (!object -> properties ) {
@@ -1666,12 +1644,12 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
1666
1644
}
1667
1645
} else {
1668
1646
if (UNEXPECTED (object -> ce -> ce_flags & ZEND_ACC_NO_DYNAMIC_PROPERTIES )) {
1669
- zend_forbidden_dynamic_property (object -> ce , key );
1647
+ zend_throw_error (NULL , "Cannot create dynamic property %s::$%s" ,
1648
+ ZSTR_VAL (object -> ce -> name ), zend_get_unmangled_property_name (key ));
1670
1649
return ;
1671
1650
} else if (!(object -> ce -> ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES )) {
1672
- if (!zend_deprecated_dynamic_property (object , key )) {
1673
- return ;
1674
- }
1651
+ zend_error (E_DEPRECATED , "Creation of dynamic property %s::$%s is deprecated" ,
1652
+ ZSTR_VAL (object -> ce -> name ), zend_get_unmangled_property_name (key ));
1675
1653
}
1676
1654
1677
1655
if (!object -> properties ) {
0 commit comments