note 11999 rejected from language.oop by sander

From: Date: Sat, 06 Apr 2002 19:03:18 +0000
Subject: note 11999 rejected from language.oop by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-28738@lists.php.net to get a copy of this message
Regarding destructors why can't you just create a function that does the cleanup for you? Ex: function destroy(){ ... cleanup code here ... } Then inside your script: $obj->destroy; unset $obj; or even: function destroy(){ ... cleanup code here ... unset $this; } Inside script: $obj->destroy; Of course I am unsure if PHP will let you unset the obj from within the class? Granted, it's not a destructor that is called automagically when the object goes out of scope, but it's better than nothing at all. NOTE: I have not used PHP since 3.06 was released and use Perl for CGI. With all the new developments since 3.06 I figured I'd look back into PHP... object-wise, though, it's not looking any better than Perl.

« previous php.notes (#28738) next »