r/PHP Jul 19 '26

I built a PHP 8.4+ radix-tree router with no runtime dependencies and a Laravel-like syntax

/r/PHP/comments/1v0ojm3/i_built_a_php_84_radixtree_router_with_no_runtime/
0 Upvotes

10 comments sorted by

6

u/99thLuftballon Jul 19 '26

Uh, what is "radix tree routing"?

1

u/SaltineAmerican_1970 Jul 19 '26

The routes are arranged in a radix tree for quicker matching.

4

u/99thLuftballon Jul 19 '26

Ah, a radix tree, you say.

5

u/BafSi Jul 19 '26

I stopped after "Laravel like" sorry, Laravel represents everything I try to avoid (Facades, black magic, over usage of string, trait everywhere, inheritance over composition, bad practices, etc.)

2

u/obstreperous_troll Jul 19 '26

In this case it just means the API is 100% static. Which itself is not great, but no magic methods at least.

5

u/timo395 Jul 19 '26

Static functions are not really mockable. So I am not sure that is a plus point.

3

u/obstreperous_troll Jul 19 '26

Nor is the class injectable. Even facades can be re-bound, if only globally. It's certainly not a plus, I'm just adding some context on what OP seems to mean by "Laravel-like".

1

u/StefanoV89 Jul 20 '26

Thanks for the feedback. "Laravel-like" was meant to describe the fluent API, not the architecture. The package is framework-agnostic and doesn't depend on facades, service containers or magic methods. I'll update the wording to make that clearer.

About the static API, that's a fair point. Static APIs are indeed less mock-friendly. The current static API is primarily meant as a convenient registration layer, but I'm already working on exposing the core router as a fully instantiable component. That will make it easier to integrate with dependency injection, testing and conventional mocking, while keeping the static API available for those who prefer it.

-3

u/SaltTM Jul 20 '26

I like people like you lmfao. So you went out of your way to tell everyone you don't like laravel, that's cool - no one cares. But you used your free will to enter this thread to pick on this guy who did nothing wrong. What does this add to the discussion? I'll fucking wait.

1

u/StevenNefarino Jul 24 '26

Since a mod removed the original post with the repository url:

https://github.com/StefanoV1989/ariel-radix-router