3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface A { public function a(): A; } class B implements A { public function a() { return $this; } } $b = new B();
based on c5cYK
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of B::a() must be compatible with A::a(): A in /in/VZGPA on line 7
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/VZGPA on line 4
Process exited with code 255.