Exemple #1
0
}
trait trt2
{
    public function detail()
    {
        return 'what is your name ? ';
    }
}
class house
{
    use trt;
    use trt2;
}
$obj = new house();
echo $obj->about() . '<br/>';
echo $obj->detail();
/************************************using multiple trait*******************************/
// trait trt {
// 	public function sayhi (){
// 		return 'hi i am from trait 1 ';
// 	}
// }
// trait trt2{
// 	public function sayhi (){
// 		return 'hi i am from trait 2 ';
// 	}
// }
// class base {
//  	use trt,trt2 {
//  		trt ::sayhi insteadof trt2; //trait method use
//  		trt :: sayhi as sayhello ;//trait method rename