<?php
trait Hello {
public function sayHello() {
echo 'Hello';
}
}
trait World {
public function sayHello() {
echo 'World';
}
}
class MyHelloWorld {
use Hello, World;
}
$o = new MyHelloWorld();
$o->sayHello();
Fatal error: Trait method World::sayHello has not been applied as MyHelloWorld::sayHello, because of collision with Hello::sayHello in /in/W7neT 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/W7neT 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/W7neT on line 17
Process exited with code 255.