Array Adapter (memory)

Array Adapter (memory)#

Factory: Cache::memory(string $namespace = 'default')

In-process array-backed adapter for fast ephemeral caching.

Characteristics:

  • no external dependencies

  • not shared across processes

  • TTL support via encoded expiration timestamps

  • suitable for tests and simple local memo/cache layers

Example:

$cache = Cache::memory('local');
$cache->set('foo', 'bar', 10);