PHPackages                             lastguest/mu - 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. lastguest/mu

ActiveLibrary[Framework](/categories/framework)

lastguest/mu
============

An URL router in only 140bytes

1.0.1(8y ago)2326215PHP

Since Jan 14Pushed 8y ago11 watchersCompare

[ Source](https://github.com/lastguest/mu)[ Packagist](https://packagist.org/packages/lastguest/mu)[ RSS](/packages/lastguest-mu/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (3)Used By (0)

µ
=

[](#µ)

a PHP micro URL router in only 140 bytes. (99 bytes in *hardcore* branch)

[![Scrutinizer Quality Score](https://camo.githubusercontent.com/a1c46498b9058ed4e7a386b1b3279e83fb2f4af46ed8bf84321d92554a86b8b6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c61737467756573742f6d752f6261646765732f7175616c6974792d73636f72652e706e673f733d65323962343762653839393362393439353765396536653966333765646436313834663663373533)](https://scrutinizer-ci.com/g/lastguest/mu/)

**Warning: This is a pure proof of concept of a tweet-sized URL router**

**DO NOT USE IT IN PRODUCTION!**

```
class µ{static function __callStatic($n,$a){static$r;$n==@_?($_=@$r[getenv(REQUEST_METHOD).getenv(REQUEST_URI)])&&$_():$r[$n.$a[0]]=$a[1];}}
```

### How to use

[](#how-to-use)

**Step 1:** Define routes callbacks

```
µ::GET('/',function(){
    echo 'What is your name?';
    echo '';
});
```

```
µ::POST('/',function(){
    echo 'Hello ',$_POST['username'],', how are you?';
});
```

**Step 2:** Run the app

```
µ::_();
```

**Step 3:** Breath.

Thanks
------

[](#thanks)

[celtric](https://github.com/celtric)

[David Pennington (Xeoncross)](https://github.com/Xeoncross)

[Tyler Romeo (Parent5446)](https://github.com/Parent5446)

Commented source
----------------

[](#commented-source)

```
class µ {
    public static function __callStatic($functionName,$functionParameters){
        static $callbackMap;

        // Check if we must resolve the request
        if($functionName == '_'){

            // Compose the method+uri key and
            // invoke the callback (silence failures)

            ($callback = @$callbackMap[getenv(REQUEST_METHOD).getenv(REQUEST_URI)]) && $callback();

        } else {

            // Add the route handler to the callbackMap
            // $functionName is the Request HTTP Method
            // $functionParameters[0] is the route
            // $functionParameters[1] is the callback

            $callbackMap[$functionName.$functionParameters[0]] = $functionParameters[1];
        }
    }
}
```

License (MIT)
-------------

[](#license-mit)

Copyright (c) 2012 Stefano Azzolini

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[![Bitdeli Badge](https://camo.githubusercontent.com/b5ecc2a679dd5613c3d5267f07093940b7b4a73df2989f4bc0fc1cf1bfe23389/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f6c61737467756573742f6d752f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 97% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00a7323d0ef535e352696bc141305b3928fce777a0f477109d2274ad17cdb9f?d=identicon)[lastguest](/maintainers/lastguest)

---

Top Contributors

[![lastguest](https://avatars.githubusercontent.com/u/178900?v=4)](https://github.com/lastguest "lastguest (32 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

---

Tags

lightweightmicro-frameworkphprouterrouterslimURL Routersinatramupicoframework

### Embed Badge

![Health badge](/badges/lastguest-mu/health.svg)

```
[![Health](https://phpackages.com/badges/lastguest-mu/health.svg)](https://phpackages.com/packages/lastguest-mu)
```

###  Alternatives

[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.2k49.9M1.3k](/packages/slim-slim)[klein/klein

A lightning fast router for PHP

2.7k1.1M30](/packages/klein-klein)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3708.0M208](/packages/slim-twig-view)[slim/php-view

Render PHP view scripts into a PSR-7 Response object.

2739.7M92](/packages/slim-php-view)[slim/csrf

Slim Framework 4 CSRF protection PSR-15 middleware

3512.1M92](/packages/slim-csrf)[slim/http-cache

Slim Framework HTTP cache middleware and service provider

1242.9M27](/packages/slim-http-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
