Caching values with Doctrine

Code
<?php

// ArrayCache only lives per request and is good for testing
use Doctrine\Common\Cache\ArrayCache;

// you can use APC, Memcache, XCache...
$cache = new ArrayCache();

$value 'I\'m worthy to be cached';

$key sha1($value);
$cache->save($key$value);

if (
$cache->contains($key)) {
    echo 
$cache->fetch($key);
}
Result
I'm worthy to be cached
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8