Accessing instance-specific data within a destructor : Destructors « Class « PHP






Accessing instance-specific data within a destructor

 
class Database {
    function __destruct() {
         db_close($this->handle); 
    }
}
  
  








Related examples in the same category

1.destuctor in action
2.Class destructors
3.Class with destructors
4.Cleaning Up with the __destruct Method (PHP 5 Only)
5.Defining an object destructor
6.Declaring and Using Object Constructors and Destructors