note 30671 deleted from function.register-shutdown-function by didou
| From: | didou@php.net | Date: | Thu, 29 May 2003 22:53:30 +0000 |
| Subject: | note 30671 deleted from function.register-shutdown-function by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49380@lists.php.net to get a copy of this message | ||
Note Submitter: Colin Guthrie
----
In addition to dmarsh's comments on18-Sep-2002 06:39,
I've found that using register_shutdown_function to simulate class destructors will loose the
values off all member variables.
It remembers the types (as reported by gettype), but the values themselves are lost.
I have a Constructor and a separate Init function in my class. The Init function sets a member
variable (mInitialised) to be true.
My Destructor (as created by the method described by dmarsh) checks to see if the class was
initialised (from calling the Init function in the code somewhere - this is not always done and
therefore does not always need the destruction code) and performs certain tasks to clean up.
Unfortunately, as the member variables have all been cleared up, my clean up code itself does not
work.
Ahh well.