From aaa1cdca31643ec6bf0f6b3a43457fd366ad0867 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Fri, 29 Aug 2003 08:51:43 +0000 Subject: [PATCH] Fix a problem in implicit public properties and inheritance --- Zend/zend_compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 7c1f005bb0..3f1f0917d7 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1756,9 +1756,10 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro /* Explicitly copy the value from the parent */ zval **pvalue; - if (zend_hash_quick_find(&parent_ce->default_properties, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &pvalue)==SUCCESS) { - zend_hash_quick_update(&ce->default_properties, hash_key->arKey, hash_key->nKeyLength, hash_key->h, pvalue, sizeof(zval *), NULL); + if (zend_hash_quick_find(&parent_ce->default_properties, parent_info->name, parent_info->name_length+1, parent_info->h, (void **) &pvalue)==SUCCESS) { + zend_hash_quick_update(&ce->default_properties, parent_info->name, parent_info->name_length+1, parent_info->h, pvalue, sizeof(zval *), NULL); (*pvalue)->refcount++; + zend_hash_del(&ce->default_properties, child_info->name, child_info->name_length+1); } return 1; /* Inherit from the parent */ } -- 2.49.0