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 66%Total: 531 All time: 5,646 This week: 206Up
Version License PHP version Categories
overload-class 1.1.0Free for non-comm...5.0PHP 5, Language


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: 301 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  
This week:0
All time:5,646
This week:206Up
User Ratings User Comments (1)
 All time
I like the concept but found a flaw in the class.
14 years ago (Fabian Schmengler)