Skip to content

PHP 8.5: Deprecation notices for __sleep and __wakeup #1287

Description

@TobiasBg

PHP 8.5 (to be released in November) deprecates the magic methods __sleep and __wakeup:
https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods

This currently causes the warning "Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)".

As long as PHP < 7.4 is supported the best fix is to simply add __serialize and __unserialize methods as wrappers (or move the logic to these and make __sleep and __wakeup the wrappers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions