<?php class Request {} class Route {} // Before: docs only: array|string|\Stringable|null /* interface FooInterface { public function getTitle(Request $request, Route $route); } */ // If we use native typehints instead interface FooInterface { public function getTitle(Request $request, Route $route): null|array|string|\Stringable; } // This is an implementation written against the original, i.e. with no return types specified. We should not break it. class SomeFoo implements FooInterface { public function getTitle(Request $request, Route $route) { return 'yay'; } } $test = new SomeFoo(); var_dump($test->getTitle(new Request(), new Route()));
You have javascript disabled. You will not be able to edit any code.