1. Go to this page and download the library: Download antevenio/memoize library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
antevenio / memoize example snippets
Antevenio\Memoize\Memoizable;
use Antevenio\Memoize\Memoize;
use Antevenio\Memoize\Cache;
class Toolbox
{
public function multiply($argument)
{
echo "Called with {$argument}\n";
return $argument * 2;
}
public function throwException($argument)
{
echo "Called with {$argument}\n";
throw new \Exception($argument);
}
}
$toolbox = new Toolbox();
$memoize = new Memoize((new Cache())->setEntryLimit(100));