3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NewsSite { function __construct(NewsSiteContext $context) {} } interface NewsSiteContext { function gimmeDb(): PDO; function gimmeApi(): API; function gimmeFileSystem(): FileSystem; } class SpecificNewsContext { function gimmeDb(): PDO { return Registry::get('PDO1'); } function gimmeApi(): API return Registry::get('API2'); } function gimmeFileSystem(): FileSystem return Registry::get('FileSystem3'); } }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.6
Parse error: syntax error, unexpected 'return' (T_RETURN), expecting ';' or '{' in /in/lH5qA on line 19
Process exited with code 255.

preferences:
169.78 ms | 1387 KiB | 35 Q