3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class User {} class Baby extends User {} interface UserGateway { function find($id): User; } class UserGateway_MySql implements UserGateway { // must return User or subtype of User function find($id) { return new User(); } }
Output for 7.0.0 - 7.2.6
Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in /in/1upNP on line 10
Process exited with code 255.
Output for hhvm-3.15.4
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/1upNP on line 7
Process exited with code 255.