PHPackages                             aop-io/php-aop - 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. aop-io/php-aop

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

aop-io/php-aop
==============

Implements a simplified subset of AOP pragmatism and provides the AOP (Aspect Oriented Programming) features for PHP.

v0.1(11y ago)22451MITPHPPHP &gt;=5.4

Since Aug 14Pushed 11y ago3 watchersCompare

[ Source](https://github.com/aop-io/php-aop)[ Packagist](https://packagist.org/packages/aop-io/php-aop)[ Docs](http://aop.io)[ RSS](/packages/aop-io-php-aop/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

AOP for PHP
===========

[](#aop-for-php)

Implements a simplified subset of AOP (Aspect Oriented Programming) pragmatism and provides the AOP features for PHP application.

Only one dependency, the *code interceptor*.

The PHP lib of AOP.io provides an abstraction layer easy to use for AOP development, so it can work with several PHP code interceptors.

The first interceptor implemented uses [PECL AOP-PHP extension](https://github.com/aop-io/pecl-aop-interceptor).

Other interceptors are planned. If you want to create an interceptor, see the [skeleton](https://github.com/aop-io/skeleton-interceptor).

Getting Started
---------------

[](#getting-started)

### Install

[](#install)

1. Install an interceptor, e.g: [PECL AOP-PHP extension](https://github.com/aop-io/pecl-aop-interceptor).
2. Download [PHP AOP.io lib](https://github.com/aop-io/php-aop/archive/master.zip) (and configure your autoloader) or use composer `require: "aop-io/php-aop"`.

### Usage

[](#usage)

```
use Aop\Aop;

// Init
new Aop();

function hello($name)
{
    return $name
}

// Interception of kind 'around'
Aop::addAround('hello()', function($joinPoint) {

    // In this context,
    // $joinPoint is an instance of \Aop\JoinPoint\AroundFunctionJoinPoint

    // get an array with all arguments values
    var_dump($joinPoint->getArgs()); // (array) 0 => World !

    // change the return value
    $joinPoint->setReturnValue('Hello Nico !');

    // Proceed the execution of the function ( hello() )
    $joinPoint->proceed();
});

echo hello('World !'); // Hello Nico !
```

- [Documentation](http://aop.io)
- [API doc](http://aop.io/api/php/)

License
-------

[](#license)

[MIT](https://github.com/aop-io/php-aop/blob/master/LICENSE) (c) 2013, Nicolas Tallefourtane.

Author
------

[](#author)

[![Nicolas Tallefourtane - Nicolab.net](https://camo.githubusercontent.com/03b0aa01a190618acc57432930c9ca7d8b3cec2152fed75890604db5398820f6/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f64376464306634373639663361613438613365636233303866306234353766633f733d3634)](http://nicolab.net)[Nicolas Talle](http://nicolab.net)[![Make a donation via Paypal](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PGRH4ZXP36GUC)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4341d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1688162?v=4)[Nicolas Talle](/maintainers/Nicolab)[@Nicolab](https://github.com/Nicolab)

---

Top Contributors

[![Nicolab](https://avatars.githubusercontent.com/u/1688162?v=4)](https://github.com/Nicolab "Nicolab (2 commits)")

---

Tags

eventaopinjectionioclibinterceptorpatch monkey

### Embed Badge

![Health badge](/badges/aop-io-php-aop/health.svg)

```
[![Health](https://phpackages.com/badges/aop-io-php-aop/health.svg)](https://phpackages.com/packages/aop-io-php-aop)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.0k526.1M158](/packages/doctrine-event-manager)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k317.3M3.2k](/packages/symfony-property-access)[league/event

Event package

1.6k153.4M207](/packages/league-event)[friendsofphp/proxy-manager-lts

Adding support for a wider range of PHP versions to ocramius/proxy-manager

1.2k147.4M152](/packages/friendsofphp-proxy-manager-lts)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k72.5M255](/packages/laminas-laminas-eventmanager)[php-di/invoker

Generic and extensible callable invoker

26764.7M69](/packages/php-di-invoker)

PHPackages © 2026

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