note 43738 deleted from language.oop.magic-functions by danbrown

From: Date: Sat, 07 Nov 2009 18:55:01 +0000
Subject: note 43738 deleted from language.oop.magic-functions by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-162507@lists.php.net to get a copy of this message
Note Submitter: Eric at Footsteps dot nl ---- It appears, that although __wakeup() can read from global defined variables // global $variable; , changing those variables don't affect them outside __wakeup(). The same thing seems to happen when an object is being serialized in a session when you start your session. if your __wakeup() function tries to set something within your session it might get overwritten/lost. In my situation it happened when an object in an object in a session tried to change a session variable on __wakup(). In my case, putting the variable in $GLOBAL and moving the variable in the session at a later time, is a satisfying workaround.

« previous php.notes (#162507) next »