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;