PHPackages                             devco/event-emitter - 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. devco/event-emitter

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

devco/event-emitter
===================

Port of NodeJSs EventEmitter to PHP 5.4 using traits

v1.0.2(14y ago)0111.4k↓35.7%16MITPHPPHP &gt;=5.4.0

Since Apr 5Pushed 12y ago2 watchersCompare

[ Source](https://github.com/devco/EventEmitter)[ Packagist](https://packagist.org/packages/devco/event-emitter)[ Docs](https://github.com/christopherobin/EventEmitter)[ RSS](/packages/devco-event-emitter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (6)

EventEmitter
============

[](#eventemitter)

This is a direct port of the [*EventEmitter*](https://github.com/joyent/node/blob/master/lib/events.js) class from [node.js](https://github.com/joyent/node/) using PHP 5.4 traits.

Why PHP 5.4?
------------

[](#why-php-54)

Due to the nature of the *EventEmitter* functionnality, using simple extends sounds like the wrong way to deal with it as it is a set of functionnality to add to an existing class instead of your class extending the functionnalities of EventEmitter. As such traits are the best way to implement this kind of functionnality and those are only available to PHP 5.4+.

How to Use
----------

[](#how-to-use)

```
