cache_get / CacheBackendInterface::get() return value doc needs attention

Created on 6 July 2011, over 13 years ago
Updated 23 April 2024, 8 months ago

API page: http://api.drupal.org/api/drupal/includes--cache.inc/function/cache_get/7

Describe the problem you have found:

The Docs appear to say that cache_get returns the data unserialised when in fact it returns an object (the complete row from the cache table) that contains an element called 'data' that has the unserilased data in it. It may well just need clarifying.

🐛 Bug report
Status

Active

Version

7.0 ⚰️

Component
Documentation 

Last updated 1 day ago

No maintainer
Created by

🇬🇧United Kingdom tobyontour

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    cache_get() now says Returns data from the persistent cache. and cache_get will automatically return unserialized objects and arrays.

    IMO, that does not mean that the value returned from cache_get() is an object or an array. I read it as saying that the returned data contains unserialized objects and arrays, which is true.
    It is not explicit about what value it returns, and for that reason, I cannot say the returned value is an array.

Production build 0.71.5 2024