3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface A { function x(self $o); } class B implements A { function x(self $o) { return $o; } } class C extends B { } $c = new C(); var_dump($c->x($c));
based on pfiJ1
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of B::x(B $o) must be compatible with A::x(A $o) in /in/FU3BJ on line 7
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Declaration of B::x() must be compatible with A::x(A $o) in /in/FU3BJ on line 7
Process exited with code 255.
Output for 5.3.20 - 5.3.29
object(C)#1 (0) { }