From: Nikita Popov Date: Fri, 25 Jan 2019 10:03:29 +0000 (+0100) Subject: Merge branch 'PHP-7.3' X-Git-Tag: php-7.4.0alpha1~1156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f13557843f636dc2f81bbc034b145947c020e16;p=php Merge branch 'PHP-7.3' --- 7f13557843f636dc2f81bbc034b145947c020e16 diff --cc Zend/zend_object_handlers.c index be967847dc,7d200402a9..c883a878f0 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -1413,10 -1381,14 +1413,10 @@@ ZEND_API void zend_class_init_statics(z if (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count) { if (class_type->parent) { - zend_intenal_class_init_statics(class_type->parent); + zend_class_init_statics(class_type->parent); } -#if ZTS - CG(static_members_table)[(zend_intptr_t)(class_type->static_members_table)] = emalloc(sizeof(zval) * class_type->default_static_members_count); -#else - class_type->static_members_table = emalloc(sizeof(zval) * class_type->default_static_members_count); -#endif + ZEND_MAP_PTR_SET(class_type->static_members_table, emalloc(sizeof(zval) * class_type->default_static_members_count)); for (i = 0; i < class_type->default_static_members_count; i++) { p = &class_type->default_static_members_table[i]; if (Z_TYPE_P(p) == IS_INDIRECT) { @@@ -1430,17 -1402,10 +1430,12 @@@ } } /* }}} */ - ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */ - { - zend_intenal_class_init_statics(class_type); - } /* }}} */ - -ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent) /* {{{ */ +ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, zend_property_info **property_info_ptr) /* {{{ */ { - zend_property_info *property_info = zend_hash_find_ptr(&ce->properties_info, property_name); zval *ret; + zend_class_entry *scope; + zend_property_info *property_info = zend_hash_find_ptr(&ce->properties_info, property_name); + *property_info_ptr = property_info; if (UNEXPECTED(property_info == NULL)) { goto undeclared_property; @@@ -1473,13 -1428,13 +1468,13 @@@ } } - /* check if static properties were destoyed */ + /* check if static properties were destroyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - if (ce->type == ZEND_INTERNAL_CLASS) { + if (ce->type == ZEND_INTERNAL_CLASS || (ce->ce_flags & ZEND_ACC_IMMUTABLE)) { - zend_intenal_class_init_statics(ce); + zend_class_init_statics(ce); } else { undeclared_property: - if (!silent) { + if (type != BP_VAR_IS) { zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name)); } return NULL;