ID:               31502
 User updated by:  kubis at pawouk dot net
 Reported By:      kubis at pawouk dot net
 Status:           Open
 Bug Type:         Session related
 Operating System: WinXP SP2
 PHP Version:      5.0.3
 New Comment:

once more the __wakeup() function; i messed it up:

function __wakeup(){
   $this->logger->logfile.... // you won't find '/tmp/user.log' here,
you won't find the $logtype variable at all.
}


Previous Comments:
------------------------------------------------------------------------

[2005-01-12 02:15:32] kubis at pawouk dot net

Description:
------------
I have found that sometimes if you have an object A as a member of a
another object B and your try to store the object B in session AND you
are using wddx serializer as default session serializer, after
deserialization back from session the object A in member of object B
deserializes wrong. While using the standard php serializer, all seems
working perfectly.

Reproduce code:
---------------
class Logger {
  public $logfile;
  public $logtype;
  function __construct(){
     $this->logfile = '/tmp/user.log';
  }
// some logger class implementation

}

class User {
  public $logger;

function __construct()
   $this->logger = new Logger();
}

function __wakeup(){
   $this->logger->logtype .... // you won't find '/tmp/user.log' here,
you won't find the $logtype variable at all.
}



Expected result:
----------------
I am expecting that the value of $this->logger->logtype would be the
'/tmp/user.log' string; but there is not any value at all, and it seems
there is not any member 'logfile' at all. While debugging using Zend
studio i have seen that all members of the Logger class have lost their
names; there were just some numbers.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31502&edit=1

Reply via email to