note 27076 deleted from language.oop.magic-functions by jsheets
| From: | jsheets@php.net | Date: | Fri, 22 Nov 2002 00:12:59 +0000 |
| Subject: | note 27076 deleted from language.oop.magic-functions by jsheets | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39840@lists.php.net to get a copy of this message | ||
Hi all
I have some issues with the '__sleep()' function in 'extended' classes.
Firstly, here is a simplified example of my class setup:-
class A
{
var $one;
var $two;
Function SomeFunctions ...()
Function __sleep()
{
return array('one', 'two');
}
}
class B extends A
{
var $three
Function SomeMoreFunctions ...()
Function __sleep()
{
return array( 'three', 'one', 'two');
}
}
My issue is that variable $three never gets recreated in subsequent pages. Variables $one and $two
get re-created perfectly. So what's going on here .... is there some specific call order I
should be following OR does '__sleep' and '__wakeup' not work across class
hierachies and only works for the base class.
Please help someone !
Thanks