Login   Register  
PHP Classes
elePHPant
Icontem

Overload: Emulate class function overloading

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 (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-05-21 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 513 All time: 5,229 This week: 1,595Up
Version License PHP version Categories  
overload-class 1.1.0Free for non-commercial...5.0PHP 5, Language
Description Author  

This class implements class function overloading.

It is a base class that allows sub-classes to have functions that may be called in several ways using with a different number of arguments or arguments with different types.

The base class intercept calls to the overloaded functions and dispatches those calls according to the types and number of arguments.

Innovation Award  
PHP Programming Innovation award nominee
April 2009
Number 6
Overloading is a feature built-in in some Object Oriented languages like C++.

It allows calling a class function with the same name but is implemented in multiple ways depending on the number and type of parameters that are passed to a function.

Currently PHP does not provide built-in functionality to provide overload support exactly like in C++. There is an overload extension in PECL but it is not exactly the same thing.

This class provides overload functionality emulation using PHP 5 magic methods.

Manuel Lemos
Picture of Ralf Mike Pretzlaw
Name: Ralf Mike Pretzlaw <contact>
Classes: 3 packages by
Country: Germany Germany
Age: 30
All time rank: 1926125 in Germany Germany
Week rank: 1605 Up82 in Germany Germany Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file Overload.class.php Class Overload-Class for "overloading in PHP"
Accessible without login Plain text file Example.php Example Example for overloading an object in PHP with some does and dont's
Accessible without login Plain text file Help.txt Doc. Summary of the functionality
Accessible without login Plain text file LICENSE.txt Lic. License

 Version Control Unique User Downloads Download Rankings  
 0%Total:513All time:5,229
 This week:0This week:1,595Up
 User Comments (1)  
 
I like the concept but found a flaw in the class.
5 years ago (Fabian Schmengler)
67%StarStarStarStar