summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-05-04 18:56:35 +0000
committerMarcus Boerger <helly@php.net>2003-05-04 18:56:35 +0000
commit9d251cde97507340f9b8a7dfd4c611a459db4f41 (patch)
tree592f5732ae00d89e19bf9c7b4699d5ea18ae5836 /Zend
parent75c01dd66bc7d9572cfb5e98674b82f4e2297ade (diff)
downloadphp-git-9d251cde97507340f9b8a7dfd4c611a459db4f41.tar.gz
Don't inherit twice what is needed only once
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_compile.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 49e9fb459d..7660b9751f 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1617,17 +1617,19 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
return;
}
- if (!zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) {
- if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) {
- /* inherit parent's constructor */
- zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL);
- function_add_ref(function);
- }
- }
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **) &function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
function_add_ref(function);
+ } else {
+ /* don't inherit the old style constructor if we already have the new style cconstructor */
+ if (!zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) {
+ if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) {
+ /* inherit parent's constructor */
+ zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL);
+ function_add_ref(function);
+ }
+ }
}
ce->constructor = ce->parent->constructor;
if (!ce->__get) {