iGuest 3 Report post Posted January 21, 2005 i forgot the code to know when the class is destroyedsomething like class A { function end() { echo('destroyed')} } Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 21, 2005 You mean a destructor? Those are new to PHP5. If you're using PHP5, you can do the following: class a { function __destruct() { echo "Destroying " . $this->name . "n"; }}This will be called whenever the object goes out of scope or the script ends.If you don't have PHP5, then you can make a function which will echo the words you want, but you will have to call it manually.class a { function destroy() { echo"Destroying ".$this->name."n"; }}$obj = new a();a->destroy(); Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 22, 2005 aha ok i will try it out!this host doesnt use php5 :? Share this post Link to post Share on other sites