Login   Register  
PHP Classes
elePHPant
Icontem

Destructor: Implement class destructors under PHP 4

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-10-26 (9 years ago) RSS 2.0 feedStarStarStar 55%Total: 1,048 All time: 3,285 This week: 1,439Up
Version License Categories  
destructor 1.0GNU General Public Lice...Language
Description Author  

This class can be used to implement class destructor functionality in a way that it works under PHP 4.

It works as a base class that keeps track of all objects that are created by its subclasses.

If a PHP script attempts to exit before an object is destroyed, a shutdown function is called to explicitly destroy any pending objects.

Innovation Award  
PHP Programming Innovation award nominee
November 2005
Number 8
When an object of a class is destroyed, sometimes is necessary to execute maintenance tasks, like for instance freeing resources allocated during the object life time. Usually this is done using destructor functions. However, class destructor functions are not supported under PHP 4.

This class provides an alternative solution that consists on registering a shutdown function that assures that the class destructor function is always called until the end of the current script.

Manuel Lemos
Picture of Bryan Smith
Name: Bryan Smith <contact>
Classes: 3 packages by
Country: Canada Canada
Age: 36
All time rank: 124734 in Canada Canada
Week rank: 1078 Up25 in Canada Canada Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file DESTRUCTOR.php Class DESTRUCTOR Class
Plain text file Sample.php Example How to use DESTRUCTOR class.

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1Total:1,048All time:3,285
 This week:0This week:1,439Up
User Ratings User Comments (1)  
 All time
Utility:81%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1213
 
Excellent
5 years ago (kishore kumar)
70%StarStarStarStar