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