From cb00ed2bd36afcc76b3dd47ba886e53ff626ab0d Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 27 Feb 2001 05:18:34 +0000 Subject: [PATCH] Don't overwrite existing handlers with parent ones. --- Zend/zend_compile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); } -- 2.50.1