dev-master
9999999-dev https://github.com/kdaviesnz/memoizationWrapper for Ed Mann's memoize function
MIT
The Requires
- php ~7.0
The Development Requires
by Kevin Davies
memoization kdaviesnz
Wrapper for Ed Mann's memoize function
Wrapper for Ed Mann's memoize function, (*1)
see https://eddmann.com/posts/implementing-and-using-memoization-in-php/, (*2)
Via Composer, (*3)
``` bash $ composer require kdaviesnz/Memoization, (*4)
## Usage ``` php $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";
Please see CHANGELOG.md for more information on what has changed recently., (*5)
bash
$ composer test
, (*6)
Please see CONTRIBUTING.md and CODE_OF_CONDUCT.md for details., (*7)
If you discover any security related issues, please email kdaviesnz@gmail.com instead of using the issue tracker., (*8)
The MIT License (MIT). Please see LICENSE.md for more information., (*9)
Wrapper for Ed Mann's memoize function
MIT
memoization kdaviesnz