"Sputnik" help  
Sputnik Help
Language Reference - Classes - Class Magic Functions - Destruct

Class Magic Functions - Destruct

This function is immediately executed when an instance of a class is destroyed by any means including the unset() function.

// define a class
class test
{
    Function __Construct()
    {
        say "A test class is created";
    }
    Function __Destruct()
    {
        say "A test class is destroyed";
    }
}

// create new instance
my $a = new test();

// destroy the instance
unset($a);

// PRINTS
// A test class is made with value Hello
// A test class is made with value World

A full list of all possible magic functions can be found here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org