diff options
author | Pedro Magalhães <mail@pmmaga.net> | 2017-09-30 21:24:38 +0100 |
---|---|---|
committer | krakjoe <krakjoe@php.net> | 2017-11-22 05:35:24 +0000 |
commit | 179ed6e43d9703fe6bdaa286aec79f7e131a8ab0 (patch) | |
tree | f679e2ab3fe690cd67b28e9b4f64514ef5e27222 /Zend/zend_inheritance.c | |
parent | f3545165b2417b5e54b8da888d39f35c5793e684 (diff) | |
download | php-git-179ed6e43d9703fe6bdaa286aec79f7e131a8ab0.tar.gz |
63911: Compare opcodes of the op_array to determine different functions
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r-- | Zend/zend_inheritance.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index c7391f96f7..7f253d90ea 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1165,6 +1165,11 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s zend_function *new_fn; if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) { + /* if it is the same function regardless of where it is coming from, there is no conflict and we do not need to add it again */ + if (existing_fn->op_array.opcodes == fn->op_array.opcodes) { + return; + } + if (existing_fn->common.scope == ce) { /* members from the current class override trait methods */ /* use temporary *overriden HashTable to detect hidden conflict */ |