1--TEST-- 2Trait method overriddes base class method 3--FILE-- 4<?php 5error_reporting(E_ALL); 6 7class Base { 8 public function sayHello() { 9 echo 'Hello '; 10 } 11} 12 13trait SayWorld { 14 public function sayHello() { 15 echo 'World!'; 16 } 17} 18 19class MyHelloWorld extends Base { 20 use SayWorld; 21} 22 23$o = new MyHelloWorld(); 24$o->sayHello(); 25?> 26--EXPECTF-- 27World! 28