case ZEND_INIT_METHOD_CALL:
if (opline->op1_type == IS_UNUSED
&& opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING
- && op_array->scope && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) {
+ && op_array->scope
+ && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)
+ && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) {
zend_string *method_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1);
zend_function *fbc = zend_hash_find_ptr(
&op_array->scope->function_table, method_name);