The __wakeup() serialization magic method has been deprecated.

Description

Class serialization in PHP has had multiple mechanism introduced to control its behaviour by userland. Initially with the __sleep() and __wakeup() magic methods, then with the Serializable interface and finally with __serialize() and __unserialize().

In the end, the __serialize and __unserialize methods must be used, instead of __sleep and __wakeup.

Example

<?php

class X {
    function __sleep() {}
}

?>

Solutions

  • Rename the method to __unserialize.

See Also

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.