<?php
interface Dog {
public function woof();
}
class Terrier implements Dog {
public function woof() {
echo 'woof';
}
}
class Staffie extends Terrier {
}
$dog = new Staffie();
theBestDog($dog);
function theBestDog(Dog $dog){
echo 'The best dogs is ' . get_class($dog);
$dog->woof();
}