PHPackages                             m1n64/lru-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. m1n64/lru-cache

ActiveLibrary

m1n64/lru-cache
===============

1.1.0(1y ago)0221MITPHPPHP ^8.1

Since Oct 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/m1n64/lru-cache)[ Packagist](https://packagist.org/packages/m1n64/lru-cache)[ RSS](/packages/m1n64-lru-cache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (1)

LRU Cache realisation
=====================

[](#lru-cache-realisation)

Description
-----------

[](#description)

`LRUCache` is an implementation of a cache based on the Least Recently Used (LRU) algorithm, which automatically removes the least recently used items when the specified capacity limit is reached. This class is useful for optimizing performance by retaining only the most relevant data.

Installation
------------

[](#installation)

Make sure you have PHP version 8.1 or higher installed. You can install this package via Composer:

```
composer require m1n64/lru-cache
```

Usage
-----

[](#usage)

### Example

[](#example)

```
