<?php trait CanWhatever { public function doStuff() { return 'result!'; } } class X { use CanWhatever; public function doStuff() { return 'overridden!'; } } $x = new X(); echo $x->doStuff(); echo "\n\$x has "; echo (class_uses($x, 'CanWhatever')) ? 'the trait' : 'no trait';
You have javascript disabled. You will not be able to edit any code.