2017 © Pedro Peláez
 

library memoization

Wrapper for Ed Mann's memoize function

image

kdaviesnz/memoization

Wrapper for Ed Mann's memoize function

  • Wednesday, June 6, 2018
  • by kdaviesnz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Memoization

Wrapper for Ed Mann's memoize function, (*1)

see https://eddmann.com/posts/implementing-and-using-memoization-in-php/, (*2)

Install

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";

Change log

Please see CHANGELOG.md for more information on what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING.md and CODE_OF_CONDUCT.md for details., (*7)

Security

If you discover any security related issues, please email kdaviesnz@gmail.com instead of using the issue tracker., (*8)

Credits

  • kdaviesnz@gmail.com

License

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

Memoization

The Versions

06/06 2018

dev-master

9999999-dev https://github.com/kdaviesnz/memoization

Wrapper for Ed Mann's memoize function

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

memoization kdaviesnz