summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-03-23 08:14:41 +0000
committerZeev Suraski <zeev@php.net>2003-03-23 08:14:41 +0000
commit0aef71ff89f8968a8a1b2169f1f1b297ee867b1d (patch)
treebb7c09b9003db2aa644a7984463fa77ae4f4c8f5
parent2dc388e73ed76ec3271acc5e7fa6579873b39abd (diff)
downloadphp-git-0aef71ff89f8968a8a1b2169f1f1b297ee867b1d.tar.gz
Another fix for implicit public, perhaps it was not such a good idea :I
-rw-r--r--Zend/zend_compile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 77d469a676..f53aca28c4 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1698,6 +1698,13 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
+ /* 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);
+ (*pvalue)->refcount++;
+ }
return 1; /* Inherit from the parent */
}
return 0; /* Don't copy from parent */