<?php
error_reporting(E_ALL);
interface Animal {}
class Cat implements Animal {}
class Shelter {
function adopt(Animal $a) {}
}
class CatShelter {
function adopt(Cat $a) {}
}
$cat = new Cat;
$shelter = new Shelter;
$shelter->adopt($cat);
$catShelter = new CatShelter;
$catShelter->adopt($cat);