$dispatcher = FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) { $r->addRoute('GET', '/user/{id:\d+}', 'UserController@show'); }); $routeInfo = $dispatcher->dispatch('GET', '/user/123'); switch ($routeInfo[0]) { case FastRoute\Dispatcher::NOT_FOUND: // ... 404 Not Found break; case FastRoute\Dispatcher::METHOD_NOT_ALLOWED: $allowedMethods = $routeInfo[1]; // ... 405 Method Not Allowed break; case FastRoute\Dispatcher::FOUND: $handler = $routeInfo[1]; $vars = $routeInfo[2]; // ... call $handler with $vars break; }In this example, we define a single route for a `GET` request to `/user/{id:\d+}`, where `id` is a numeric value. If a user visits this URL, the `UserController@show` function will be called. We then use the `simpleDispatcher` function to create a dispatcher object, which we can use to match incoming requests to our defined routes. We call the `dispatch` method with the incoming request method (`GET`) and URL (`/user/123`), which returns an array with information about the matched route. We use a `switch` statement to handle the different cases that can be returned by the `dispatch` method, such as a route not being found or the method not being allowed for a given route. Overall, a PHP router package library like FastRoute can help make URL routing more manageable and improve the performance of an application.