]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3'
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 25 Jan 2019 10:03:29 +0000 (11:03 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 25 Jan 2019 10:03:29 +0000 (11:03 +0100)
1  2 
Zend/zend_object_handlers.c

index be967847dc1eb80f148084d1d51922b716aa0a65,7d200402a92c64440a2fa07cc9bad637fe5f6531..c883a878f02a94925f6d826ff025aa4cd4c8288b
@@@ -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) {
        }
  } /* }}} */
  
- 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;
                }
        }
  
 -      /* 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;