Skip to content

Conversation

TobiasBg
Copy link

PHP 8.5 deprecates the __sleep() and __wakeup() magic methods in favor of __serialize() and __unserialize().

See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods

For PHP < 7.4 compatibility, __sleep() and __wakeup() need to be kept for the time being.

This commit moves the logic of the __wakeup() method to __unserialize(), and turns the former into a wrapper. The SDK does not use __sleep() methods, so this is the only change required.

PHP 8.5 deprecates the `__sleep()` and `__wakeup()` magic methods in favor of `__serialize()` and `__unserialize()`.

See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods

For PHP < 7.4 compatibility, `__sleep()` and `__wakeup()` need to be kept for the time being.

This commit moves the logic of the `__wakeup()` method to `__unserialize()`, and turns the former into a wrapper. The SDK does not use `__sleep()` methods, so this is the only change required.
@TobiasBg
Copy link
Author

Ok, this might need some more code to actually restore properties, see the ongoing discussion at https://core.trac.wordpress.org/ticket/63962#comment:11 and following comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant