3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { } class B extends A { } class C { public function woot(A $foo) { return $foo; } } class D extends C { public function woot(B $foo) { return $foo; } } $test = new D(); var_dump($test->woot(new B()));
Output for 7.0.0 - 7.2.0
Warning: Declaration of D::woot(B $foo) should be compatible with C::woot(A $foo) in /in/qWJSW on line 14 object(B)#2 (0) { }
Output for 5.4.0 - 5.6.28
Strict Standards: Declaration of D::woot() should be compatible with C::woot(A $foo) in /in/qWJSW on line 14 object(B)#2 (0) { }
Output for 5.3.19 - 5.3.29
Strict Standards: Declaration of D::woot() should be compatible with that of C::woot() in /in/qWJSW on line 14 object(B)#2 (0) { }