Check if cache cid exist I have this code:

$cache = \Drupal::cache();
$result = $cache-&gt;get('tdcf_00SPH46T');


Then, I got this notice:

Notice: Undefined index: tdcf_00SPH46T in Drupal\Core\Cache\DatabaseBackend-&gt;getMultiple() (line 92 of core/lib/Drupal/Core/Cache/DatabaseBanckend.php).
Drupal\Core\Cache\DatabaseBackend-&gt;getMultiple(Array, ) Line: 63
Drupal\Core\Cache\DatabaseBackend-&gt;get('tdcf_00SPH46T')_(Line: 46)
...


Is any way for check if this cid is defined, for example:

$cache-&gt;has('tdcf_00SPH46T');
What database backend are you using? Sounds like a case problem, that a cache entry with a different upper/lower case version exists and then it can't map that back. I'd suggest using only lowercase but this shouldn't happen IMHO and it doesn't for me:

&gt;&gt;&gt; $cache = \Drupal::cache();
=&gt; Drupal\Core\Cache\DatabaseBackend {#48
     +"_serviceId": "cache.default",
   }
&gt;&gt;&gt; $cache-&gt;get('foo');
=&gt; false
&gt;&gt;&gt; $cache-&gt;set('foo', 'bar');
=&gt; null
&gt;&gt;&gt; $cache-&gt;get('foo');
=&gt; {#9809
     +"cid": "foo",
     +"data": "bar",
     +"created": "1505412278.945",
     +"expire": "-1",
     +"serialized": "0",
     +"tags": [],
     +"checksum": "0",
     +"valid": true,
   }
&gt;&gt;&gt; $cache-&gt;get('Foo');
=&gt; false