From 0a93d54c538d222c7f2b5c51d9b189b3bebad5a7 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 10 Mar 2005 13:20:26 +0000 Subject: [PATCH] - Bugfix #28442 --- Zend/tests/bug28442.phpt | 65 ++++++++++++++++++++++++++++++++++++++++ Zend/zend_compile.c | 6 ---- 2 files changed, 65 insertions(+), 6 deletions(-) create mode 100755 Zend/tests/bug28442.phpt diff --git a/Zend/tests/bug28442.phpt b/Zend/tests/bug28442.phpt new file mode 100755 index 0000000000..1237357cca --- /dev/null +++ b/Zend/tests/bug28442.phpt @@ -0,0 +1,65 @@ +--TEST-- +Bug #28442 (Changing a static variables in a class changes it across sub/super classes.) +--FILE-- + +===DONE=== +--EXPECTF-- +===INIT=== +string(1) "A" +string(1) "C" +string(1) "C" +===SetA=== +string(2) "A2" +string(1) "C" +string(1) "C" +===SetB=== +string(2) "A2" +string(2) "B2" +string(2) "B2" +===SetC=== +string(2) "A2" +string(2) "C2" +string(2) "C2" +===DONE=== diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a2741faa42..51ed1623d9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1984,12 +1984,6 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro zend_hash_del(&ce->default_properties, prot_name, prot_name_length+1); } pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS); - } else if (!(child_info->flags & ZEND_ACC_PRIVATE) && (child_info->flags & ZEND_ACC_STATIC)) { - char *prop_name, *tmp; - - zend_unmangle_property_name(child_info->name, &tmp, &prop_name); - zend_error(E_COMPILE_ERROR, "Cannot redeclare property static %s %s::$%s in class %s", - zend_visibility_string(child_info->flags), parent_ce->name, prop_name, ce->name); } return 0; /* Don't copy from parent */ } else { -- 2.40.0