PHPackages                             php-compatible/router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. php-compatible/router

ActiveLibrary[Framework](/categories/framework)

php-compatible/router
=====================

PHP 8-style routing for PHP 4+ - Modern routing API that works on legacy PHP

v1.0.0(4mo ago)00[1 issues](https://github.com/php-compatible/router/issues)MITPHPPHP &gt;=5.5CI passing

Since Dec 30Pushed 4mo agoCompare

[ Source](https://github.com/php-compatible/router)[ Packagist](https://packagist.org/packages/php-compatible/router)[ RSS](/packages/php-compatible-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP Compatible Router
=====================

[](#php-compatible-router)

[![CI](https://github.com/php-compatible/router/actions/workflows/ci.yml/badge.svg)](https://github.com/php-compatible/router/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/4c66f81afba189ef4420a5764b8dde92b2b405edfa5749a028f98a8a4153f35f/68747470733a2f2f636f6465636f762e696f2f67682f7068702d636f6d70617469626c652f726f757465722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/php-compatible/router)[![PHP Version](https://camo.githubusercontent.com/648fd4043ad1c6bc7ca4afda2b41a7d7a03c84e87512ef4615f5acbcc49569ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e352532302d2d253230382e352d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

**Modern routing for legacy PHP applications** — Write clean routes today, upgrade to modern frameworks tomorrow.

The Problem
-----------

[](#the-problem)

You're maintaining a PHP application that's been around for years. Maybe it started on PHP 4 or 5. The codebase works, but:

- Routes are scattered across dozens of files with mixed HTTP verbs
- `.htaccess` rewrites have become impossible to follow
- You want to modernize, but a full framework migration isn't feasible right now
- Your team needs to support multiple PHP versions during the transition

The Solution
------------

[](#the-solution)

This router meets you where you are. Whether you're on PHP 5.5 or PHP 8.5, you get the same clean, expressive API. No conditional syntax, no version-specific features — just routing that works.

```
