I'm porting some code from PHP 4 to PHP 5. It's not liking this:
$s = _SESSION['x'];
$this = unserialize($s); // error: can't assign to $this
The reason I'm doing this is to have a class method called "LoadFromSession". If you have a better way to do this, please tell me.
My basic question is this:
In PHP 5, I would like to be able to copy over the contents of the current object. Is there a way to assign a new object to the current object (pointed to by $this)? For eg:
$this = $otherobject_of_same_type;
It this were C++, I would do this:
*this = object;
Thanks.