PHPackages                             axy/callbacks - 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. axy/callbacks

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

axy/callbacks
=============

Extension of php-callback format

1.0.3(10y ago)14601[1 issues](https://github.com/axypro/callbacks/issues)3MITPHPPHP &gt;=5.4.0

Since Dec 26Pushed 8y ago2 watchersCompare

[ Source](https://github.com/axypro/callbacks)[ Packagist](https://packagist.org/packages/axy/callbacks)[ Docs](https://github.com/axypro/callbacks)[ RSS](/packages/axy-callbacks/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (7)Used By (3)

axy\\callbacks: the callback extended format
============================================

[](#axycallbacks-the-callback-extended-format)

[![Latest Stable Version](https://camo.githubusercontent.com/06b3fc9af2cede81c70b856c5d1080810f55a68fa8daab291f6e5c0fa25984fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6178792f63616c6c6261636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axy/callbacks)[![Minimum PHP Version](https://camo.githubusercontent.com/b52c83f3d45755ebcb1e6863ebb202ab192aaf773424369ffdeedae107f027ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/745f09ed8c90b3927d5275e5c24663d76fb8c94015e58d2c09f04a6d78b46105/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f61787970726f2f63616c6c6261636b732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/axypro/callbacks)[![Coverage Status](https://camo.githubusercontent.com/4cfb817f7e5035db48c8fae07564268beae9205fe938df2cb9d0c125977a25f8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f61787970726f2f63616c6c6261636b732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/axypro/callbacks?branch=master)[![License](https://camo.githubusercontent.com/d51e9068210a69c4dba3fe130bda69c6684e349fcede6afa4e801174984881e9/68747470733a2f2f706f7365722e707567782e6f72672f6178792f63616c6c6261636b732f6c6963656e7365)](LICENSE)

- The library does not require any dependencies.
- Tested on PHP 5.4+, PHP 7, HHVM (on Linux), PHP 5.5 (on Windows).
- Install: `composer require axy/callbacks`.
- License: [MIT](LICENSE).

### Documentation

[](#documentation)

- [Callback format](doc/format.md)
- [Arguments binding](doc/args.md)
- [Context binding](doc/bind.md)
- [How to use](doc/Callback.md)

### Examples

[](#examples)

```
function sum($a, $b)
{
    return $a + $b;
}
```

Standard callback:

```
$callback = new Callback('sum');

echo $callback(2, 2);
```

Binging arguments:

```
$callback = new Callback('sum', [3]);

echo $callback(4); // 3 + 4 = 7
```

Binging context:

```
class MyClass
{
    public function getEventHandler()
    {
        return new Callback([$this, 'onEvent'], ['click'], true);
    }

    private function onEvent($event)
    {
        echo 'Event '.$event.'!';
    }
}

$obj = new MyClass();
$handler = $obj->getEventHandler();

// click
$handler(); // "Event click!". Private method was called
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~136 days

Recently: every ~163 days

Total

6

Last Release

3835d ago

Major Versions

0.0.2 → 1.0.02015-01-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5b3a2db8d5614167d4510019e3373dbba63c6aade58d38d23f3e7d2e63c3c4a?d=identicon)[axy](/maintainers/axy)

---

Top Contributors

[![vasa-c](https://avatars.githubusercontent.com/u/557081?v=4)](https://github.com/vasa-c "vasa-c (47 commits)")

---

Tags

callbackcall\_user\_func

### Embed Badge

![Health badge](/badges/axy-callbacks/health.svg)

```
[![Health](https://phpackages.com/badges/axy-callbacks/health.svg)](https://phpackages.com/packages/axy-callbacks)
```

###  Alternatives

[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[zenstruck/callback

Callable wrapper to validate and inject arguments.

569.6M4](/packages/zenstruck-callback)[axy/sourcemap

Work with JavaScript/CSS Source Map

24734.1k5](/packages/axy-sourcemap)[phpfluent/callback

Allows you execute callbacks in a more dynamic way

1159.2k1](/packages/phpfluent-callback)[foolz/plugin

A plugin system for PHP, with cascading events.

542.1k1](/packages/foolz-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
