PHPackages                             sof3/static-overloads - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sof3/static-overloads

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sof3/static-overloads
=====================

Use parameter-varying method overloads in PHP

20PHP

Since Dec 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/SOF3/static-overloads)[ Packagist](https://packagist.org/packages/sof3/static-overloads)[ RSS](/packages/sof3-static-overloads/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

static-overloads
================

[](#static-overloads)

Use parameter-varying method overloads in PHP

Pass an array of functions with different signatures into the `Overload` constructor. Invoke the `Overload` object directly with an array of the parameters you got, and the library will determine the correct implementation to use based on the parameter types.

Example:

```
function my_func(...$args){
    // We are storing the Overload object as a static-scope variable.
    // This caches the analyzed implementation signatures to improve runtime performance
    // if the function is called frequently within the same runtime.
    static $overload = null; // due to PHP language limitations, $overload cannot be initialized inline.
    $overload = $overload ?? new Overload([
        function(string $a){
            implementation1($a);
        },
        function(int $a){
            implementation2($a);
        }
    ]);
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2801890?v=4)[SOFe](/maintainers/SOFe)[@sofe](https://github.com/sofe)

---

Top Contributors

[![SOF3](https://avatars.githubusercontent.com/u/19623715?v=4)](https://github.com/SOF3 "SOF3 (3 commits)")

---

Tags

method-overloadingoverload

### Embed Badge

![Health badge](/badges/sof3-static-overloads/health.svg)

```
[![Health](https://phpackages.com/badges/sof3-static-overloads/health.svg)](https://phpackages.com/packages/sof3-static-overloads)
```

PHPackages © 2026

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