3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Fooable { } class Foo implements Fooable {} abstract class Bar { public function dump(Foo $object) { var_dump($object); } } class Baz extends Bar { public function dump(Fooable $object) { var_dump($object); } } (new Baz)->dump(new Foo);
based on 2rGZO
Output for 7.1.0 - 7.3.0beta1
Warning: Declaration of Baz::dump(Fooable $object) should be compatible with Bar::dump(Foo $object) in /in/nWVSM on line 23 object(Foo)#2 (0) { }
Output for hhvm-3.18.5 - 3.22.0
object(Foo)#2 (0) { }
Output for 5.6.0 - 5.6.30
Strict Standards: Declaration of Baz::dump() should be compatible with Bar::dump(Foo $object) in /in/nWVSM on line 23 object(Foo)#2 (0) { }