<?php
trait foo {
public function bar() {
echo 'foo->bar';
}
}
trait baz {
use foo {
foo::bar as foo_bar;
}
public function bar() {
$this->foo_bar();
echo 'baz->bar';
}
}
class bar {
use baz;
public function call_bar() {
$this->bar();
}
}
$obj=new bar();
$obj->call_bar();
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bar has a deprecated constructor in /in/BrsKe on line 25
foo->barbaz->barfoo->barbaz->bar
Fatal error: Trait method bar has not been applied, because there are collisions with other trait methods on bar in /in/BrsKe on line 31
Process exited with code 255.