PHPackages                             asm89/yac - 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. asm89/yac

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

asm89/yac
=========

Yet another container

12122PHP

Since Nov 14Pushed 12y ago3 watchersCompare

[ Source](https://github.com/asm89/yac)[ Packagist](https://packagist.org/packages/asm89/yac)[ RSS](/packages/asm89-yac/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

yac
===

[](#yac)

> Just remembered this gem from @crell at #tnphp: "Invent yet another container? You could call YAC, and shave it!" - [igorwesome](https://twitter.com/igorwesome/status/400716438841098240)

Yet another container is yet another di container for PHP, inspired by [Pimple](https://github.com/fabpot/Pimple) and [LazyMap](https://github.com/Ocramius/LazyMap). Basically blending the two together. When using it the [LazyMap](https://github.com/Ocramius/LazyMap) way it's very performant.

Defining parameters
-------------------

[](#defining-parameters)

```
$c = new Yac\Yac();
$c['env'] = 'dev';
```

Defining services
-----------------

[](#defining-services)

```
$c['session'] = function($c) { return new Session($c->env); };
```

Accessing parameters and services
---------------------------------

[](#accessing-parameters-and-services)

```
$std = $c['std']; // pimple compatible
$std = $c->std;   // "fast" LazyMap way
```

Performance
-----------

[](#performance)

Yac is much faster than Pimple!

```
 $ php -n ./vendor/bin/athletic -p ./tests/YacPerformance/ -b ./tests/bootstrap.php -f GroupedFormatter
YacPerformance\YacPerformanceEvent
  fetch_service-performance
    Method Name                                 Iterations    Average Time      Ops/s    Relative
    ------------------------------  ----------  ------------ --------------   ---------  ---------
    pimpleFetchService            : [Baseline] [100,000   ] [0.0000042015409] [238,007.91486]
    yacFetchServicePimpleStyle    :            [100,000   ] [0.0000032225394] [310,314.27956] [76.70%]
    yacFetchServiceLazyMapStyle   :            [100,000   ] [0.0000027879906] [358,681.27057] [66.36%]

  fetch_initialized_service-performance
    Method Name                                 Iterations    Average Time      Ops/s    Relative
    ------------------------------  ----------  ------------ --------------   ---------  ---------
    pimpleFetchInitializedService : [Baseline] [100,000   ] [0.0000010025978] [997,408.92228]
    yacFetchInitializedServicePimpleStyle:            [100,000   ] [0.0000007377648] [1,355,445.46456] [73.59%]
    yacFetchInitializedServiceLazyMapStyle:            [100,000 ] [0.0000002871366] [3,482,663.50475] [28.64%]
```

Known limitations
-----------------

[](#known-limitations)

- No parameter/service called `__yac`
- All services are "shared", "prototype" services are not yet supported
- ...

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/78fcc60c1d576c1f19a4c03297931f879354efbb7e054318ffe391a2a2f0a274?d=identicon)[asm89](/maintainers/asm89)

### Embed Badge

![Health badge](/badges/asm89-yac/health.svg)

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

PHPackages © 2026

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