3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
33.9 ms | 402 KiB | 5 Q