note 30671 added to function.register-shutdown-function

From: Date: Tue, 25 Mar 2003 14:14:23 +0000
Subject: note 30671 added to function.register-shutdown-function
Groups: php.notes 
Request: Send a blank email to php-notes+get-45794@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/function.register-shutdown-function.php http://master.php.net/manage/user-notes.php?action=edit+30671 http://master.php.net/manage/user-notes.php?action=delete+30671 http://master.php.net/manage/user-notes.php?action=reject+30671

« previous php.notes (#45794) next »