PSR-16 object cache for PHP.
composer require nickolasburr/ocache.php:^1.0
...
use function Ocache\cache;
$cache = cache();
$entry = $cache->get('example');
if ($entry === null) {
$entry = new \ArrayIterator(range(0, 10));
$cache->set('example', $entry);
}
...