phasync
LruCache / get

Method

LruCache::get

Returns the value stored under $key, and makes it the most recently used.

Description#

public LruCache::get(
    string $key,
    mixed $default = null
): mixed

Parameters#

$key string
The key
$default mixed = null
Returned when there is no entry, or it expired

Return values#

The value, or $default mixed

See also#

  • LruCache::hasReturns whether there is an entry for $key, and makes it the most recently used if there is.
  • LruCache::setStores $value under $key, making room as needed.