php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch bug64235.patch for Scripting Engine problem Bug #64235Patch version 2013-02-20 07:39 UTC Return to Bug #64235 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions: 2013-02-20 08:07 UTC | 2013-02-20 07:39 UTCDeveloper: laruence@php.netdiff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a3f4fe5..5744e61 100644 index a3f4fe5..d17e71a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3859,6 +3859,10 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait { Line 24 (now 24), was 18 lines, now 4 lines + } /** Ensure that the prefered method is actually available. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, @@ -3916,8 +3923,11 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name); - } - zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC); + } + + if ((cur_precedence->exclude_from_classes[j]->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC); + } /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Apr 18 15:01:28 2024 UTC |