3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar { public abstract function test(Foo $foo); } class Baz extends Bar { public function test($foo) { var_dump($foo); } } $f = new Foo(); $z = new Baz(); $z->test($f); $z->test(true);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Bar::test) in /in/ugfk3 on line 4
Process exited with code 255.

preferences:
185.72 ms | 1395 KiB | 65 Q