[wp-trac] [WordPress Trac] #63061: Prepare for PHP 8.5

WordPress Trac noreply at wordpress.org
Tue Sep 23 19:26:19 UTC 2025


#63061: Prepare for PHP 8.5
-----------------------------+--------------------------------
 Reporter:  johnbillion      |       Owner:  (none)
     Type:  task (blessed)   |      Status:  new
 Priority:  normal           |   Milestone:  6.9
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  php85 has-patch  |     Focuses:  php-compatibility
-----------------------------+--------------------------------

Comment (by SergeyBiryukov):

 In [changeset:"60796" 60796]:
 {{{
 #!CommitTicketReference repository="" revision="60796"
 Code Modernization: Address `__sleep()` and `__wakeup()` deprecations in
 PHP 8.5.

 PHP 8.5 deprecates the `__sleep()` and `__wakeup()` magic methods in favor
 of `__serialize()` and `__unserialize()`:
 > `Deprecated:  The __wakeup() serialization magic method has been
 deprecated. Implement __unserialize() instead (or in addition, if support
 for old PHP versions is necessary)`

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

 This commit moves the logic of `__wakeup()` methods in core to
 `__unserialize()`, and turns the former into wrappers. WordPress core does
 not use `__sleep()` methods, so these are the only changes required.

 Reference:
 [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
 PHP RFC: Deprecations for PHP 8.5: Deprecate the __sleep() and __wakeup()
 magic methods].

 Follow-up to [56835], [60787], [60795].

 Props TobiasBg, tusharbharti, swissspidy, dmsnell, SergeyBiryukov.
 Fixes #63962. See #63061.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63061#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list