<?php




// abstract class Animal {

//     public $fullName = "my pet";

//     abstract public function makeSound($name); 

//     public function canPlay() {

//         return "my pet is playing";
//     }
// }


// class Dog extends Animal {


//     public function makeSound($name) {


//         return $this->fullName . " is barking";
//     }
// }



// class Cat extends Animal {


//     public function makeSound($name) {


//         return $this->fullName . " is meowing ";
//     }
// }


// $dog = new Dog;

//  echo $dog->makeSound("Fluffy");

//  echo "<br>";
//  echo $dog->canPlay();

// echo "<br>";


// $cat = new Cat;

// echo $cat->makeSound("My Cat");


interface Animal {

    
    public function makeSound();
}



interface CanRun {

    public function isRunning();

}

class Dog implements Animal, CanRun {

    public function makeSound() {

        echo "my dog barks";
    }

    public function isRunning() {

        echo "my dog is running";
    }

}


class Cat implements Animal, CanRun {

    public function makeSound() {

        echo "my cat meows";
    }


    public function isRunning() {

        echo "my cat is running";
    }

}

//$dog = new Dog();

// echo $dog->makeSound();
// echo "<br>";
// echo $dog->isRunning();


// echo "<br>";


// $cat = new Cat();

// echo $cat->makeSound();

// echo "<br>";
// echo $cat->isRunning();


function triggerSound(Animal $animal) {

    $animal->makeSound();

} 

triggerSound(new Dog());
echo "<br>";
triggerSound(new Cat());



function triggerCanRun(CanRun $runner) {

    $runner->isRunning();

} 
echo "<br>";
triggerCanRun(new Dog());

echo "<br>";
triggerCanRun(new Cat());