PHPackages                             daveross/phpoverloading - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. daveross/phpoverloading

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

daveross/phpoverloading
=======================

Method overloading for PHP objects

v1.0(9y ago)019MITPHP &gt;=5.5

Since Jul 3Compare

[ Source](https://github.com/daveross/PHPOverloading)[ Packagist](https://packagist.org/packages/daveross/phpoverloading)[ RSS](/packages/daveross-phpoverloading/feed)WikiDiscussions Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP Overloading [![Build Status](https://camo.githubusercontent.com/a19d333e0a39cdd2f2242eab03257393b94d1bc9693f67f26c722cee7af40038/68747470733a2f2f7472617669732d63692e6f72672f64617665726f73732f5048504f7665726c6f6164696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/daveross/PHPOverloading) [![Latest Stable Version](https://camo.githubusercontent.com/4e9a31a2452c63611c71c5f0c59d088a2d758a10f9de713504718ab7802ded0a/68747470733a2f2f706f7365722e707567782e6f72672f64617665726f73732f7068706f7665726c6f6164696e672f762f737461626c65)](https://packagist.org/packages/daveross/phpoverloading) [![Total Downloads](https://camo.githubusercontent.com/831798098cfde9d1e9e7b544055535d531b9ea6a5f7a16179c2b466c37a60219/68747470733a2f2f706f7365722e707567782e6f72672f64617665726f73732f7068706f7665726c6f6164696e672f646f776e6c6f616473)](https://packagist.org/packages/daveross/phpoverloading) [![License](https://camo.githubusercontent.com/f099c940aed652db23651d79e12658dbc0830206e7fe5c5766218e09f987e880/68747470733a2f2f706f7365722e707567782e6f72672f64617665726f73732f7068706f7665726c6f6164696e672f6c6963656e7365)](https://packagist.org/packages/daveross/phpoverloading)
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-overloading----)

[PHP trait](http://php.net/manual/en/language.oop5.traits.php) providing a form of method overloading in PHP. Useful when porting code from languages which support method overloading, and that's about the only time you should seriously consider using this library.

Seriously, if you're thinking of using it for new PHP code, ask yourself why. There's no reason to add this kind of overhead, not to mention the cognitive load of weird method names, just to overload methods. PHP has gone this long without native method overloading. It can go longer without it.

Just stop. Think of the children.

License
-------

[](#license)

[MIT](http://daveross.mit-license.org)

See [why I contribute to open source software](https://medium.com/@csixty4/why-i-write-open-source-software-6d3569c85e64#.hq00fw10b).

[Buy me a coffee](https://cash.me/$daveross/5)

Contributing
------------

[](#contributing)

Pull requests are welcome. Unit tests are encouraged but not required.

Installation
------------

[](#installation)

### Using composer

[](#using-composer)

Put the require statement for `phpoverloading` in your `composer.json` file and run `composer install` or `php composer.phar install`:

```
{
    "require": {
        "daveross/phpoverloading": "~1.0"
    }
}
```

### Manually

[](#manually)

Include the file in the `src` directory, or individual files as needed:

```
