mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
Remove ZEND_ACC_IMPLEMENTS_TRAITS flag
This is equivalent to checking ce->num_traits.
This commit is contained in:
+2
-3
@@ -6471,7 +6471,6 @@ void zend_compile_use_trait(zend_ast *ast) /* {{{ */
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
uint32_t i;
|
||||
|
||||
ce->ce_flags |= ZEND_ACC_IMPLEMENT_TRAITS;
|
||||
ce->trait_names = erealloc(ce->trait_names, sizeof(zend_class_name) * (ce->num_traits + traits->children));
|
||||
|
||||
for (i = 0; i < traits->children; ++i) {
|
||||
@@ -6665,7 +6664,7 @@ zend_op *zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
|
||||
|
||||
if (toplevel
|
||||
/* We currently don't early-bind classes that implement interfaces or use traits */
|
||||
&& !(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))
|
||||
&& !(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES) && !ce->num_traits
|
||||
&& !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)) {
|
||||
if (extends_ast) {
|
||||
zend_class_entry *parent_ce = zend_lookup_class_ex(
|
||||
@@ -6726,7 +6725,7 @@ zend_op *zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
|
||||
if (extends_ast && toplevel
|
||||
&& (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING)
|
||||
/* We currently don't early-bind classes that implement interfaces or use traits */
|
||||
&& !(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))
|
||||
&& !(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES) && !ce->num_traits
|
||||
) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_EARLY_BINDING;
|
||||
opline->opcode = ZEND_DECLARE_CLASS_DELAYED;
|
||||
|
||||
+1
-4
@@ -229,7 +229,7 @@ typedef struct _zend_oparray_context {
|
||||
/* op_array or class is preloaded | | | */
|
||||
#define ZEND_ACC_PRELOADED (1 << 10) /* X | X | | */
|
||||
/* | | | */
|
||||
/* Class Flags (unused: 13, 24...) | | | */
|
||||
/* Class Flags (unused: 13, 15, 24...) | | | */
|
||||
/* =========== | | | */
|
||||
/* | | | */
|
||||
/* Special class types | | | */
|
||||
@@ -254,9 +254,6 @@ typedef struct _zend_oparray_context {
|
||||
/* Class implements interface(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 14) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class uses trait(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 15) /* X | | | */
|
||||
/* | | | */
|
||||
/* User class has methods with static variables | | | */
|
||||
#define ZEND_HAS_STATIC_IN_METHODS (1 << 16) /* X | | | */
|
||||
/* | | | */
|
||||
|
||||
@@ -2460,7 +2460,7 @@ ZEND_API int zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_nam
|
||||
}
|
||||
zend_do_inheritance(ce, parent);
|
||||
}
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
|
||||
if (ce->num_traits) {
|
||||
zend_do_bind_traits(ce);
|
||||
}
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES) {
|
||||
|
||||
@@ -4150,14 +4150,14 @@ static int preload_optimize(zend_persistent_script *script)
|
||||
}
|
||||
|
||||
ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) {
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
|
||||
if (ce->num_traits) {
|
||||
preload_fix_trait_methods(ce);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
ZEND_HASH_FOREACH_PTR(preload_scripts, script) {
|
||||
ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) {
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
|
||||
if (ce->num_traits) {
|
||||
preload_fix_trait_methods(ce);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
Reference in New Issue
Block a user