<?php
trait Hello1 {
public function sayHello() {
echo 'Hello';
}
}
trait Hello2 {
public function sayHello() {
echo 'World';
}
}
class MyHelloWorld {
use Hello1, Hello2;
}
$o = new MyHelloWorld();
$o->sayHello();
Fatal error: Trait method Hello2::sayHello has not been applied as MyHelloWorld::sayHello, because of collision with Hello1::sayHello in /in/RqUsX on line 14
Process exited with code 255.
Fatal error: Trait method sayHello has not been applied, because there are collisions with other trait methods on MyHelloWorld in /in/RqUsX on line 14
Process exited with code 255.
Fatal error: Trait method sayHello has not been applied, because there are collisions with other trait methods on MyHelloWorld in /in/RqUsX on line 17
Process exited with code 255.