Login   Register  
PHP Classes

Defer: Defer executing of code to emulate final functions

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Ralf Mike Pretzlaw
Name: Ralf Mike Pretzlaw <e-mail contact>
Packages: 3 Browse all classes by Ralf Mike Pretzlaw Browse all classes by
Country: Germany Germany - PHP jobs in Germany
Age: 30
All time rank: 1886122 in Germany Germany
Week rank: 1348 Up73 in Germany Germany Up
Innovation award
Innovation award
Nominee: 2x

  Detailed description   Download Download .zip .tar.gz  
This class can defer executing of code to emulate final functions.

It can register functions to be called when the object is destroyed, so the functions are only executed when the current function or scope ends and the class destructor is called.

The class can also register references to variables that will also be unset by the class destructor when the current function or scope ends.

  Classes of Ralf Mike Pretzlaw  >  Defer  >  Download Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Defer
Base name: defer
Description: Defer executing of code to emulate final functions
Version: 1.0
PHP version: 5.3
License: BSD License
All time users: 333 users
All time rank: 6218
Week users: 1 user
Week rank: 1884 Up
  Groups   Rate classes User ratings   Applications   Files Files  

Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes

  Innovation Award  
PHP Programming Innovation award nominee
January 2013
Number 4
The finally construct introduced in PHP 5.5 allows developers to defined some code that will always be executed regardless if an exception is thrown.

This class implements a different approach to achieve the same purpose of finally, except that it works even in older PHP versions.

It uses cleverly a class destructor function to execute code that will always be executed when an object is destructed while PHP is exiting the function or scope on which an object of this class was created.

Manuel Lemos

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file Defer.php Class Defer class (unset variable and run function later)
Accessible without login Plain text file defer-example.php Example Exmaples

Download Download all files: defer.tar.gz defer.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.