PHP code example of kalibora / memoization
1. Go to this page and download the library: Download kalibora/memoization 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/ */
kalibora / memoization example snippets
namespace App;
use Kalibora\Memoization\MemoizationTrait;
class HeavyProcessor
{
use MemoizationTrait;
public function process(): void
{
return $this->getMemoization()->memoize(__FUNCTION__, function () {
// Very heavy processing takes place here.
return $value;
});
}
}