Example #1
0
{
    public function say()
    {
        echo "woof!" . PHP_EOL;
    }
}
class Animal
{
    use Cat, Dog {
        Cat::say insteadof Dog;
        // use Cat::say instead of Dog::say
        Dog::say as bark;
    }
}
$odd = new Animal();
$odd->say();
$odd->bark();
// change visibility
trait Hero
{
    public function feelBad()
    {
        echo "I'm feeling bad" . PHP_EOL;
    }
}
class SuperHero
{
    use Hero {
        feelBad as private;
    }
    public function feeling()