PHP Classes

Overload: Emulate class function overloading

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 74%Total: 530 All time: 5,642 This week: 404Up
Version License PHP version Categories
overload-class 1.1.0Free for non-comm...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: 39
All time rank: 2085129 in Germany Germany
Week rank: 346 Up14 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:530
This week:0
All time:5,642
This week:404Up
User Ratings User Comments (1)
 All time
Utility:91%StarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:100%StarStarStarStarStarStar
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:74%StarStarStarStar
Rank:149
 
I like the concept but found a flaw in the class.
13 years ago (Fabian Schmengler)
67%StarStarStarStar