<?php
trait Foo {
public function foo() { echo "hi\n"; }
}
trait foo2 {
public function foo() { echo "bye\n"; }
}
class Bar {
use Foo, foo2 {
Foo::foo as baz;
}
}
$b = new Bar;
$b->baz();
$b->foo();
Fatal error: Trait method foo2::foo has not been applied as Bar::foo, because of collision with Foo::foo in /in/Sta1J on line 11
Process exited with code 255.
Fatal error: Trait method foo has not been applied, because there are collisions with other trait methods on Bar in /in/Sta1J on line 11
Process exited with code 255.
Fatal error: Trait method foo has not been applied, because there are collisions with other trait methods on Bar in /in/Sta1J on line 15
Process exited with code 255.