<?php
trait FooTrait {
public function foo() {
var_dump('qwer');
}
}
class Foo {
use FooTrait;
public function foo() {
var_dump('asdf');
}
}
$foo = new Foo();
$foo->foo();
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/OTmnV on line 7
string(4) "asdf"
string(4) "asdf"