Fetches a value from the cache, with the option of calculating on miss
public get ( string | integer $key, callable $callback = null, mixed $default = null ) : mixed | ||
$key | string | integer | A plain string ID for the cache entry |
$callback | callable | Logic for calculating the cache entry on miss |
$default | mixed | Default value returned if the value is missing and no callback is provided |
return | mixed | The cache value or the $default if no value and no callable |