3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use React\Promise\PromiseInterface; interface MiddlewareInterface { /** * @param RequestInterface $request * @param callable $next * @return PromiseInterface<ResponseInterface>|ResponseInterface */ public function __invoke(RequestInterface $request, callable $next); } final class BrowserMiddlewareStub implements MiddlewareInterface { /** @var ResponseInterface */ private $response; public function __construct(ResponseInterface $response) { $this->response = $response; } /** * @param RequestInterface $request * @param callable $next * @return PromiseInterface<ResponseInterface>|ResponseInterface */ public function __invoke(RequestInterface $request, callable $next) { return $this->response; } }
Output for 5.3.29, 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13

preferences:
61.51 ms | 406 KiB | 5 Q