Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
martijnc opened this issue Oct 31, 2023 · 2 comments
Open

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

martijnc opened this issue Oct 31, 2023 · 2 comments

Comments

@martijnc
Copy link

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

@nicolas-grekas
Copy link
Member

Isn't the solution to provide a fix to igbinary/igbinary#273?
A friendly ping there should help.
Meanwhile, we could skip using igbinary by default indeed when saving objects.
Can you please send a PR doing so?

@PegaseMarket
Copy link

Hello,
I have the same problem, but my php version is 7.4.33, igbinary is 3.2.7 and Symfony 5.4.38.
I don't understand why I always get this same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants