Add rector to migrate __sleep() to __serialize()#7212
Add rector to migrate __sleep() to __serialize()#7212TomasVotruba merged 11 commits intorectorphp:mainfrom
Conversation
9b6aa04 to
9ec79ce
Compare
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.
Not implemented in PHP core yet. I think it will be added soon. I’ll add __wakeup soon. |
|
php/php-src#19682 already merged |
rules-tests/Php85/Rector/MethodCall/SleepToSerializeRector/Fixture/skip_sleep_empty.php.inc
Outdated
Show resolved
Hide resolved
rules-tests/Php85/Rector/MethodCall/SleepToSerializeRector/Fixture/skip_sleep_null.php.inc
Outdated
Show resolved
Hide resolved
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.
|
I can compile the new PHP source code and check it. |
|
Okay, I think we can wait for more eye to check, or wait until can be reproduced at https://3v4l.org/ |
|
https://3v4l.org/51uu0#vgit.master Please check it. |
rules-tests/Php85/Rector/Class_/SleepToSerializeRector/Fixture/skip_sleep_null.php.inc
Outdated
Show resolved
Hide resolved
|
Thank you 👏 |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |

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