Skip to content

[Cache] igbinary_serialize is not compatible with serialize anymore #52391

@martijnc

Description

@martijnc

Symfony version(s) affected

5.x, 6.x

Description

As of PHP 7.4.6 (doctrine/common#886 (comment)), PHP's serialize function ignores uninitialized properties and no longer triggers an error. The same change was not (yet) made in igbinary's igbinary_serialize, there is a ticket to change this though.

Symfony Cache DefaultMarshaller still treats igbinary_serialize as a drop-in replacement for serialize but this is no longer true. Trying to serialize entities with igbinary installed now results in the same error we used to get with serialize.

Typed property Proxies_CG_\App\Entity\EntityName::$ must not be accessed before initialization (in __sleep)

How to reproduce

Serialize an object with an uninitialised property through Symfony cache with the default marshaller config.

Possible Solution

It is possible to disable igbinary through the cache.default_marshaller service but Symfony may want to consider disabling it by default as it no longer is a drop-in replacement.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy