3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface bird { /*function setKind(string $type); function getKind(); function getLocation(); function setLocation(location $location); function flyTo(location $location); function setMelody(string $melody); function singMelody(); // вывод зависит от kind function killBird();*/ function cloneBird(int $count); } class Sparrow implements bird { public function cloneBird($count) { echo $count; } } $s = new Sparrow(); var_dump($s);
based on ootdU
Output for 7.2.0
object(Sparrow)#1 (0) { }
Output for 7.0.0 - 7.1.10
Fatal error: Declaration of Sparrow::cloneBird($count) must be compatible with bird::cloneBird(int $count) in /in/vpNr1 on line 22
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Declaration of Sparrow::cloneBird() must be compatible with bird::cloneBird(int $count) in /in/vpNr1 on line 23
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Fatal error: Declaration of Sparrow::cloneBird() must be compatible with that of bird::cloneBird() in /in/vpNr1 on line 23
Process exited with code 255.