diff options
author | Kévin Dunglas <dunglas@gmail.com> | 2014-12-08 15:24:44 +0100 |
---|---|---|
committer | Julien Pauli <jpauli@php.net> | 2014-12-12 14:58:23 +0100 |
commit | ee226b961c2871dd2f454fa707fc23e4af5cf263 (patch) | |
tree | 0c72726fa173bdb03a44250bfca22a673b4fc54a /Zend/zend_compile.c | |
parent | fbe9b2c088b7fe75cda6668448841ae1e1fcf59b (diff) | |
download | php-git-ee226b961c2871dd2f454fa707fc23e4af5cf263.tar.gz |
Fixed Bug #65576 (Constructor from trait conflicts with inherited constructor)
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ae9409e715..17170acc69 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3842,7 +3842,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint if (!strncmp(mname, ZEND_CLONE_FUNC_NAME, mname_len)) { ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; } else if (!strncmp(mname, ZEND_CONSTRUCTOR_FUNC_NAME, mname_len)) { - if (ce->constructor) { + if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) { zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; @@ -3867,7 +3867,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint zend_str_tolower_copy(lowercase_name, ce->name, ce->name_length); lowercase_name = (char*)zend_new_interned_string(lowercase_name, ce->name_length + 1, 1 TSRMLS_CC); if (!memcmp(mname, lowercase_name, mname_len)) { - if (ce->constructor) { + if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) { zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; |