- Core:
. Fixed bug #77494 (Disabling class causes segfault on member access).
(Dmitry)
+ . Fixed bug #77498 (Custom extension Segmentation fault when declare static
+ property). (Nikita)
- Mbstring:
. Fixed bug #77514 (mb_ereg_replace() with trailing backslash adds null byte).
--- /dev/null
+--TEST--
+Inherit internal static property into userland class
+--SKIPIF--
+<?php if (!extension_loaded('zend-test')) die('skip requires zend-test'); ?>
+--FILE--
+<?php
+
+class Test extends _ZendTestClass {
+}
+
+var_dump(Test::$_StaticProp);
+_ZendTestClass::$_StaticProp = 42;
+var_dump(Test::$_StaticProp);
+
+?>
+--EXPECT--
+NULL
+int(42)
}
if (UNEXPECTED(parent_ce->type != ce->type)) {
/* User class extends internal */
+ if (CE_STATIC_MEMBERS(parent_ce) == NULL) {
+ zend_class_init_statics(parent_ce);
+ }
if (UNEXPECTED(zend_update_class_constants(parent_ce) != SUCCESS)) {
ZEND_ASSERT(0);
}
}
/* }}} */
-static void zend_intenal_class_init_statics(zend_class_entry *class_type) /* {{{ */
+ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
{
int i;
zval *p;
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
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
if (ce->type == ZEND_INTERNAL_CLASS) {
- zend_intenal_class_init_statics(ce);
+ zend_class_init_statics(ce);
} else {
undeclared_property:
if (!silent) {
#define ZEND_PROPERTY_NOT_EMPTY ZEND_ISEMPTY /* Property is not empty */
#define ZEND_PROPERTY_EXISTS 0x2 /* Property exists */
+ZEND_API void zend_class_init_statics(zend_class_entry *ce);
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent);
ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);