]> granicus.if.org Git - php/commitdiff
Don't overwrite existing handlers with parent ones.
authorAndrei Zmievski <andrei@php.net>
Tue, 27 Feb 2001 05:18:34 +0000 (05:18 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 27 Feb 2001 05:18:34 +0000 (05:18 +0000)
Zend/zend_compile.c

index a3a0c31b826ce11bb62077f7a556ea6e928285e4..df35e91949ed2b301e9e4db798b930ffdc06cc95 100644 (file)
@@ -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);
 }