Least Recently Used cache for PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/cash
tests
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

LRU Cache

Build Status

Implements a non-persistent memory-based Least Recently Used cache.

The keys can be integers or strings. The values can be anything. Because this library uses array(), keys that are strings that contain an integer ("7") are cast to an integer. Therefore, there is no difference between the key "7" and the key 7.

$cache = new LRUCache(10);
$cache->put('line1', 'roses are red');
$cache->put('line2', 'violets are blue');
$line1 = $cache->get('line1');