PHPackages                             upscale/stdlib-overloading - 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. upscale/stdlib-overloading

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

upscale/stdlib-overloading
==========================

PHP7 function/method arguments overloading

1.0.3(6y ago)03Apache-2.0PHPPHP &gt;=7.1CI failing

Since Feb 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/upscalesoftware/stdlib-overloading)[ Packagist](https://packagist.org/packages/upscale/stdlib-overloading)[ Docs](https://github.com/upscalesoftware/stdlib-overloading)[ RSS](/packages/upscale-stdlib-overloading/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

Function Overloading [![Build Status](https://camo.githubusercontent.com/dfb55c78ff3e872ce4c7b06530a0b89bce0ab8fbfbd74c48c19548fee397e22b/68747470733a2f2f6170692e7472617669732d63692e6f72672f75707363616c65736f6674776172652f7374646c69622d6f7665726c6f6164696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/upscalesoftware/stdlib-overloading)
==================================================================================================================================================================================================================================================================================================================================================================

[](#function-overloading-)

This library introduces function/method [overloading](https://en.wikipedia.org/wiki/Function_overloading) – varying implementation depending on input arguments.

**Features:**

- Overloading by argument types
- Overloading by number of arguments
- Efficient native type checks of PHP7
- Informative native error messages of [`TypeError`](https://www.php.net/manual/en/class.typeerror.php)
- Lightweight: no OOP, no [Reflection](https://www.php.net/manual/en/book.reflection.php)

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

[](#installation)

The library is to be installed via [Composer](https://getcomposer.org/) as a dependency:

```
composer require upscale/stdlib-overloading
```

Usage
-----

[](#usage)

### Syntax

[](#syntax)

Overload a custom function/method:

```
