3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface A { public function a() : self; } class B implements A { public function a() : self { return $this; } } $b = new B();
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of B::a(): B must be compatible with A::a(): A in /in/mmI40 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/mmI40 on line 4
Process exited with code 255.