PHP Classes

Overload: Emulate class function overloading

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 66%Total: 531 All time: 5,647 This week: 206Up
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: 40
All time rank: 2087129 in Germany Germany
Week rank: 197 Up11 in Germany Germany Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files (4)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:531
This week:0
All time:5,647
This week:206Up
User Ratings User Comments (1)
 All time
Utility:81%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:87%StarStarStarStarStar
Examples:81%StarStarStarStarStar
Tests:-
Videos:-
Overall:66%StarStarStarStar
Rank:545
 
I like the concept but found a flaw in the class.
14 years ago (Fabian Schmengler)
67%StarStarStarStar