View Single Post
  #18 (permalink)  
Old 04-22-2008, 05:53 AM
jegan jegan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 161
jegan is on a distinguished road
Default Re: PHP Classes For Beginners

Destructor
A Destructor is a special class member function (method) that has the same name as the class, preceded by (tilde), and is executed when an object is destroyed.

Usually used to deallocate any dynamically allocated memory associated with that object.

A destructor is a method which is automatically invoked when the object is destroyed.

Points to remember

1. Destructor's are invoked automatically, and cannot be invoked explicitly.
2. Destructor's cannot be overloaded. Thus, a class can have, at most, one destructor.
3. Destructor's cannot be used with struc. They are only used with classes.
4. Destructor can’t have any return type.
__________________
Thanks & Regards,
Jegan CBK
"We will either find a way, or make one!”
Reply With Quote