[PR #8895] Implement __serialize() and __unserialize() #11236

Open
opened 2026-01-22 16:10:07 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/8895

State: closed
Merged: Yes


The Serializable interface is deprecated in favor of the magic methods __serialize() and __unserialize(). PHP 8.1 will trigger a deprecation warning if a class implements Serializable but not those two magic methods.

This PR addresses this issue by adding __serialize() and __unserialize() to the SequenceGenerator class.

This does however change the serialized string on PHP 7.4 and above. I don't know if that is a problem.

**Original Pull Request:** https://github.com/doctrine/orm/pull/8895 **State:** closed **Merged:** Yes --- The `Serializable` interface is deprecated in favor of the magic methods `__serialize()` and `__unserialize()`. PHP 8.1 will trigger a deprecation warning if a class implements `Serializable` but not those two magic methods. This PR addresses this issue by adding `__serialize()` and `__unserialize()` to the `SequenceGenerator` class. This does however change the serialized string on PHP 7.4 and above. I don't know if that is a problem.
admin added the pull-request label 2026-01-22 16:10:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11236