3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface ServerRequestInterface {} interface ResponseInterface {} interface MiddlewareInterface { public function __invoke(ServerRequestInterface $request, ResponseInterface $response, MiddlewareInterface $next = null): ResponseInterface; } $app = new class { public function pipe() {} }; $app->pipe(new class implements MiddlewareInterface { public function __invoke(ServerRequestInterface $request, ResponseInterface $response, MiddlewareInterface $next = null): ResponseInterface { return $response; } });
based on 76R8p
Output for 7.0.0 - 7.2.0
Output for 5.3.19 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/CBU3B on line 8
Process exited with code 255.