PHPackages                             kdaviesnz/memoization - 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. kdaviesnz/memoization

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

kdaviesnz/memoization
=====================

Wrapper for Ed Mann's memoize function

07PHP

Since Jun 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kdaviesnz/Memoization)[ Packagist](https://packagist.org/packages/kdaviesnz/memoization)[ RSS](/packages/kdaviesnz-memoization/feed)WikiDiscussions master Synced yesterday

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

Memoization
===========

[](#memoization)

Wrapper for Ed Mann's memoize function

see

Install
-------

[](#install)

Via Composer

```
$ composer require kdaviesnz/Memoization
```

Usage
-----

[](#usage)

```
        $sleepz = \kdaviesnz\memoization\Memoization::memoize(function($time){
            sleep( $time );
            return true;
        });

        $firstTestStart = \microtime(true);
        $sleepz(1);
        $firstTestEnd = \microtime(true);

        $secondTestStart = \microtime(true);
        $sleepz(1);
        $secondTestEnd = \microtime(true);

        $firstTestTime = $firstTestEnd - $firstTestStart;
        $secondTestTime = $secondTestEnd - $secondTestStart;

        echo "First test took $firstTestTime ms\n";
        echo "Second test took $secondTestTime ms\n";
```

Change log
----------

[](#change-log)

Please see CHANGELOG.md for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see CONTRIBUTING.md and CODE\_OF\_CONDUCT.md for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

-

License
-------

[](#license)

The MIT License (MIT). Please see LICENSE.md for more information.

Memoization
===========

[](#memoization-1)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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/2062483?v=4)[kdaviesnz](/maintainers/kdaviesnz)[@kdaviesnz](https://github.com/kdaviesnz)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/kdaviesnz-memoization/health.svg)

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

PHPackages © 2026

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