Add rector to migrate __sleep() to __serialize()#7212
Merged
TomasVotruba merged 11 commits intorectorphp:mainfrom Sep 11, 2025
Merged
Add rector to migrate __sleep() to __serialize()#7212TomasVotruba merged 11 commits intorectorphp:mainfrom
TomasVotruba merged 11 commits intorectorphp:mainfrom
Conversation
samsonasik
reviewed
Sep 3, 2025
samsonasik
reviewed
Sep 3, 2025
9b6aa04 to
9ec79ce
Compare
samsonasik
reviewed
Sep 3, 2025
samsonasik
reviewed
Sep 3, 2025
samsonasik
reviewed
Sep 3, 2025
samsonasik
requested changes
Sep 3, 2025
Member
samsonasik
left a comment
There was a problem hiding this comment.
Could you give link of example the error/deprecation notice on https://3v4l.org/ for this case?
Also probably handle __wakeup as well.
Thank you.
Contributor
Author
Not implemented in PHP core yet. I think it will be added soon. I’ll add __wakeup soon. |
Contributor
|
php/php-src#19682 already merged |
samsonasik
reviewed
Sep 10, 2025
rules-tests/Php85/Rector/MethodCall/SleepToSerializeRector/Fixture/skip_sleep_empty.php.inc
Outdated
Show resolved
Hide resolved
samsonasik
reviewed
Sep 10, 2025
rules-tests/Php85/Rector/MethodCall/SleepToSerializeRector/Fixture/skip_sleep_null.php.inc
Outdated
Show resolved
Hide resolved
samsonasik
requested changes
Sep 10, 2025
Member
There was a problem hiding this comment.
@arshidkv12 could you add @see comment to show deprecation notice when using old behaviour vs new behaviour via https://3v4l.org/ ? Thank you.
samsonasik
reviewed
Sep 10, 2025
Contributor
Author
|
I can compile the new PHP source code and check it. |
Contributor
Author
Member
|
Okay, I think we can wait for more eye to check, or wait until can be reproduced at https://3v4l.org/ |
Contributor
Author
|
https://3v4l.org/51uu0#vgit.master Please check it. |
samsonasik
reviewed
Sep 11, 2025
samsonasik
reviewed
Sep 11, 2025
rules-tests/Php85/Rector/Class_/SleepToSerializeRector/Fixture/skip_sleep_null.php.inc
Outdated
Show resolved
Hide resolved
Member
|
Thank you 👏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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