note 44541 deleted from function.mssql-connect by aidan
| From: | aidan@php.net | Date: | Mon, 09 Aug 2004 14:13:52 +0000 |
| Subject: | note 44541 deleted from function.mssql-connect by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74321@lists.php.net to get a copy of this message | ||
Note Submitter: nxf at sourceforget dot net
----
Just a quickie relating to making a function run as a destructor:
Make sure you run register_shutdown_function AFTER you've set any member variables from outside
the class. It seems to ignore them otherwise.
class Myclass {
var $myvar;
function Myclass()
{
...
}
function destructor()
{
...
}
function enable_destructor()
{
register_shutdown_function(array(&$this, "destructor"))
}
}
$obj = new Myclass();
and then call $obj->enable_destructor only after any variable setting has been done.
This was seen on win32 apache2.0.49/php4.3.6.