3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface InterfaceY { public function y(): string; } class X { public function y() { } } class Y extends X implements InterfaceY { public function y(): string { } }
Output for 7.0.0 - 7.0.2
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Y has a deprecated constructor in /in/05oDR on line 12 Fatal error: Constructor Y::y() cannot declare a return type in /in/05oDR on line 12
Process exited with code 255.
Output for 5.3.22 - 5.6.17
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/05oDR on line 4
Process exited with code 255.