note 84960 deleted from language.oop5.magic by cmb
| From: | cmb@php.net | Date: | Sun, 10 Nov 2019 12:35:35 +0000 |
| Subject: | note 84960 deleted from language.oop5.magic by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212980@lists.php.net to get a copy of this message | ||
Note Submitter: rc @ nospam @ vorklift dot sea oh em
----
A note: __wakeup occurs before saving the unserialization of an session object.
Therefore, $_SESSION['var']::__wakeup() setting $_SESSION['var'] = new Class()
will fail and $_SESSION['var'] will remain unchanged.
This means that if you have a pseudo-temporary object that contains a class to auto revert to, you
have to revert that session object in the initialization of the website rather than via a __wakeup()
script.