Skip to content

Commit 7f13557

Browse files
committed
Merge branch 'PHP-7.3'
2 parents 0ff71ae + f78e681 commit 7f13557

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Inherit internal static property into userland class
3+
--SKIPIF--
4+
<?php if (!extension_loaded('zend-test')) die('skip requires zend-test'); ?>
5+
--FILE--
6+
<?php
7+
8+
class Test extends _ZendTestClass {
9+
}
10+
11+
var_dump(Test::$_StaticProp);
12+
_ZendTestClass::$_StaticProp = 42;
13+
var_dump(Test::$_StaticProp);
14+
15+
?>
16+
--EXPECT--
17+
NULL
18+
int(42)

Zend/zend_object_handlers.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -1406,14 +1406,14 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
14061406
}
14071407
/* }}} */
14081408

1409-
static void zend_intenal_class_init_statics(zend_class_entry *class_type) /* {{{ */
1409+
ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
14101410
{
14111411
int i;
14121412
zval *p;
14131413

14141414
if (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count) {
14151415
if (class_type->parent) {
1416-
zend_intenal_class_init_statics(class_type->parent);
1416+
zend_class_init_statics(class_type->parent);
14171417
}
14181418

14191419
ZEND_MAP_PTR_SET(class_type->static_members_table, emalloc(sizeof(zval) * class_type->default_static_members_count));
@@ -1430,11 +1430,6 @@ static void zend_intenal_class_init_statics(zend_class_entry *class_type) /* {{{
14301430
}
14311431
} /* }}} */
14321432

1433-
ZEND_API void zend_class_init_statics(zend_class_entry *class_type) /* {{{ */
1434-
{
1435-
zend_intenal_class_init_statics(class_type);
1436-
} /* }}} */
1437-
14381433
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) /* {{{ */
14391434
{
14401435
zval *ret;
@@ -1476,7 +1471,7 @@ ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend
14761471
/* check if static properties were destroyed */
14771472
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
14781473
if (ce->type == ZEND_INTERNAL_CLASS || (ce->ce_flags & ZEND_ACC_IMMUTABLE)) {
1479-
zend_intenal_class_init_statics(ce);
1474+
zend_class_init_statics(ce);
14801475
} else {
14811476
undeclared_property:
14821477
if (type != BP_VAR_IS) {

0 commit comments

Comments
 (0)