5 ms·
I doubt the routes are evaluated with regular expressions on every request, more likely it’s matched based on an explode of /
by jonwinstanley 5y ago
I doubt the routes are evaluated with regular expressions on every request, more likely it’s matched based on an explode of /
- philo23 5y agoI think quite a lot of the PHP routers are based on regexes, for better or for worse. One of the most famous is FastRoute by nikic that (from memory) merges all your routes into one big regex and then tells you which route to dispatch based on some index that comes back in the match. I don't know how widely that specific library is still being used though or if it's since been replaced by something better. https://github.com/nikic/FastRoute https://github.com/nikic/FastRoute