PHPackages                             stefanov1989/ariel-radix-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. [HTTP &amp; Networking](/categories/http)
4. /
5. stefanov1989/ariel-radix-router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

stefanov1989/ariel-radix-router
===============================

A fast, dependency-free radix-tree HTTP router for PHP 8.4 with middleware, route groups and compiled caches.

v1.0.1(yesterday)23↑2900%MITPHP &gt;=8.4

Since Jul 19Compare

[ Source](https://github.com/StefanoV1989/ariel-radix-router)[ Packagist](https://packagist.org/packages/stefanov1989/ariel-radix-router)[ RSS](/packages/stefanov1989-ariel-radix-router/feed)WikiDiscussions Synced today

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Ariel Router
============

[](#ariel-router)

[![CI](https://camo.githubusercontent.com/e27130b142bbf66c93bf6795540b3eb306c6ef64fec102199b66f3427fa94ce4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f53746566616e6f56313938392f617269656c2d72616469782d726f757465722f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4349266c6f676f3d676974687562)](https://github.com/StefanoV1989/ariel-radix-router/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/2ed16cf7335d8027fcc28b5963788b4bfc2ff09e320e6424e4657f739b33ba8f/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f76313938392f617269656c2d72616469782d726f757465722f762f737461626c65)](https://packagist.org/packages/stefanov1989/ariel-radix-router)[![License](https://camo.githubusercontent.com/cc2116158b109bd7d0e4974b49eeb9d01c512ad4c2fa7a94cfbfd4340275132c/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f76313938392f617269656c2d72616469782d726f757465722f6c6963656e7365)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/4d6a3631e75425a18393115dc47935213c193bb3c92834b171ffa1856754bf9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344253230382e342d3737374242342e737667)](https://www.php.net/)

Ariel is a fast, dependency-free HTTP router for PHP 8.4+. It uses a radix tree instead of scanning every route, keeps static lookups independent of route position, and includes middleware lifecycle safety, route groups, constraints, named URLs, persistent-worker support, and compiled indexes.

It is a standalone library: no framework, container, or HTTP implementation is required.

Why Ariel
---------

[](#why-ariel)

- Radix-tree matching with static segments taking precedence over parameters.
- Constant-depth lookup: adding routes does not turn dispatch into a linear scan.
- Specialized fast paths for common constraints such as integers and alphanumeric IDs.
- Safe middleware lifecycles for classic PHP requests and long-running workers.
- Optional file-backed compiled indexes designed to benefit from OPcache.
- Explicit `404`/`405` distinction and configurable exception rendering.
- Route groups, optional parameters, regex fallbacks, named URLs, and class handlers.
- Laravel-like static facade plus an isolated, mockable instance API.
- Zero runtime dependencies and strict PHP 8.4 types.
- PHPUnit coverage, PHPStan level max, reproducible benchmarks, and CI on every change.

Installation
------------

[](#installation)

```
composer require stefanov1989/ariel-radix-router
```

Quick start
-----------

[](#quick-start)

```
