<?php trait Foo { function test() { var_dump( $this->whatever() ); } } class A { use Foo; public function whatever() { return 42; } } class B { use Foo; private function whatever() { return 'hello'; } } class C { use Foo; } (new A)->test(); (new B)->test(); (new C)->test();
You have javascript disabled. You will not be able to edit any code.