Implement __serialize() and __unserialize()#8895
Conversation
Signed-off-by: Alexander M. Turek <me@derrabus.de>
885256e to
ae4bcd6
Compare
greg0ire
left a comment
There was a problem hiding this comment.
I don't know either if the string change will be an issue.
SenseException
left a comment
There was a problem hiding this comment.
Will this string be somehow shared between versions for any reason in a project? Otherwise I don't see an issue with this.
|
This could be problematic imho in a patch release as we don't have the version number in the cache key of Metadata Cache. What would happen if on PHP 7.4 this was serialized before this change and then unserialized after this change? Will that work? |
|
Tested it and it still works to unserialize an old string, so good to go from my POV. |
|
Unserializing old strings still works as long as we keep the |
|
Thanks @derrabus ! |
The
Serializableinterface is deprecated in favor of the magic methods__serialize()and__unserialize(). PHP 8.1 will trigger a deprecation warning if a class implementsSerializablebut not those two magic methods.This PR addresses this issue by adding
__serialize()and__unserialize()to theSequenceGeneratorclass.This does however change the serialized string on PHP 7.4 and above. I don't know if that is a problem.