cash / lrucache
An efficient memory-based Least Recently Used (LRU) cache
Installs: 3 634 714
Dependents: 6
Suggesters: 0
Security: 0
Stars: 33
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-11-19 07:25:20 UTC
README
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');