<?php

trait ABC{
    
    public function test(){
     echo 'inside ABC trait';        
    }
}

trait XYZ{
    
    public function test(){
     echo 'inside XYZ trait';        
    }
}


class testClass{
    
    use ABC,XYZ{
        ABC::test insteadof XYZ;
    }
}

$testobj = new testClass();
$testobj -> test();

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: