From: Andrei Zmievski Date: Tue, 27 Feb 2001 05:18:34 +0000 (+0000) Subject: Don't overwrite existing handlers with parent ones. X-Git-Tag: php-4.0.5RC1~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb00ed2bd36afcc76b3dd47ba886e53ff626ab0d;p=php Don't overwrite existing handlers with parent ones. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a3a0c31b82..df35e91949 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1103,9 +1103,12 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0); ce->parent = parent_ce; - ce->handle_property_get = parent_ce->handle_property_get; - ce->handle_property_set = parent_ce->handle_property_set; - ce->handle_function_call = parent_ce->handle_function_call; + if (!ce->handle_property_get) + ce->handle_property_get = parent_ce->handle_property_get; + if (!ce->handle_property_set) + ce->handle_property_set = parent_ce->handle_property_set; + if (!ce->handle_function_call) + ce->handle_function_call = parent_ce->handle_function_call; do_inherit_parent_constructor(ce); }