}
?>
--EXPECTF--
-Fatal error: Trait method M1 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
+Fatal error: Trait method B::M1 has not been applied as MyClass::M1, because of collision with A::M1 in %s on line %d
}
?>
--EXPECTF--
-Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on TraitsTest in %s on line %d
+Fatal error: Trait method THello2::hello has not been applied as TraitsTest::hello, because of collision with THello1::hello in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method smallTalk has not been applied, because there are collisions with other trait methods on Talker in %s on line %d
+Fatal error: Trait method B::smallTalk has not been applied as Talker::smallTalk, because of collision with A::smallTalk in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method test has not been applied, because there are collisions with other trait methods on bar in %s on line %d
+Fatal error: Trait method c::test has not been applied as bar::test, because of collision with foo::test in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method test has not been applied, because there are collisions with other trait methods on bar in %s on line %d
+Fatal error: Trait method baz::test has not been applied as bar::test, because of collision with foo::test in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
+Fatal error: Trait method World::world has not been applied as MyClass::world, because of collision with Hello::world in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method sayHello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
+Fatal error: Trait method World::sayHello has not been applied as MyClass::sayHello, because of collision with Hello::sayHello in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
+Fatal error: Trait method World::world has not been applied as MyClass::hello, because of collision with Hello::hello in %s on line %d
?>
--EXPECTF--
-Fatal error: Trait method __clone has not been applied, because there are collisions with other trait methods on bar in %s on line %d
+Fatal error: Trait method baz::__clone has not been applied as bar::__clone, because of collision with foo::__clone in %s on line %d
} else if (UNEXPECTED((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT)
&& !(existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT))) {
/* two traits can't define the same non-abstract method */
-#if 1
- zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s",
- ZSTR_VAL(name), ZSTR_VAL(ce->name));
-#else /* TODO: better error message */
zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s",
ZSTR_VAL(fn->common.scope->name), ZSTR_VAL(fn->common.function_name),
ZSTR_VAL(ce->name), ZSTR_VAL(name),
ZSTR_VAL(existing_fn->common.scope->name), ZSTR_VAL(existing_fn->common.function_name));
-#endif
} else {
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fulfills the inheritance requirements */