diff --git a/core/lib/Drupal/Core/Cache/MemoryBackend.php b/core/lib/Drupal/Core/Cache/MemoryBackend.php index 76bff41eb5424f54446524c7e4fa484fb34bcd04..edda4d37f94dbf7bf3e1cda3b453729655fbfa89 100644 --- a/core/lib/Drupal/Core/Cache/MemoryBackend.php +++ b/core/lib/Drupal/Core/Cache/MemoryBackend.php @@ -10,6 +10,11 @@ * Should be used for unit tests and specialist use-cases only, does not * store cached items between requests. * + * The functions ::prepareItem()/::set() use unserialize()/serialize(). It + * behaves as an external cache backend to avoid changing the cached data by + * reference. In ::prepareItem(), the object is not modified by the call to + * unserialize() because we make a clone of it. + * * @ingroup cache */ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterface {