PHPackages                             h4kuna/memoize - 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. [Caching](/categories/caching)
4. /
5. h4kuna/memoize

ActiveTool[Caching](/categories/caching)

h4kuna/memoize
==============

Provide cache to memory for your class.

v0.1.8(3mo ago)6158.4k↑10.1%4MITPHPPHP &gt;=8.0.0CI failing

Since Mar 6Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/h4kuna/memoize)[ Packagist](https://packagist.org/packages/h4kuna/memoize)[ Fund](https://revolut.me/milan2m/czk1000/memoize)[ GitHub Sponsors](https://github.com/h4kuna)[ RSS](/packages/h4kuna-memoize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (13)Used By (4)

Memoize
=======

[](#memoize)

[![Downloads this Month](https://camo.githubusercontent.com/011fb15d2be258b8a3bcf4cc25fe6ce3e6d555ee504590b043bc76ec96fe9535/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f68346b756e612f6d656d6f697a652e737667)](https://packagist.org/packages/h4kuna/memoize)[![Latest stable](https://camo.githubusercontent.com/192c8f5a775b29ee8cefbc75b71513691292a4b0e7dce96f240ef47d3f5e4433/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68346b756e612f6d656d6f697a652e737667)](https://packagist.org/packages/h4kuna/memoize)

Is one trait whose provide cache to memory for classes. This is abstract standard use case how cache data for one request. Example is below.

Api is easy where is one method **memoize** where first parameter is unique key string or array and second parameter is callback. This trait clear class.

Install by composer

```
$ composer require h4kuna/memoize

```

### Standard use case

[](#standard-use-case)

```
