PHPackages                             emonkak/underbar.php - 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. emonkak/underbar.php

Abandoned → [emonkak/collection](/?search=emonkak%2Fcollection)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

emonkak/underbar.php
====================

A collection processing library for PHP, like Underscore.js

0.3.0(12y ago)4011.7k31MITPHPPHP &gt;=5.4.0

Since Jul 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/emonkak/underbar.php)[ Packagist](https://packagist.org/packages/emonkak/underbar.php)[ Docs](http://emonkak.github.io/underbar.php/)[ RSS](/packages/emonkak-underbarphp/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (10)Used By (1)

Underbar.php [![Build Status](https://camo.githubusercontent.com/a3726c3bcd79e89cdfd48047f896d153844695c5272a08bf8a69267943a72d93/68747470733a2f2f7472617669732d63692e6f72672f656d6f6e6b616b2f756e6465726261722e7068702e706e67)](https://travis-ci.org/emonkak/underbar.php)
============================================================================================================================================================================================================================================================================

[](#underbarphp-)

Underbar.php is a collection processing library for PHP, like underscore.js.

However not aim full compatibility of undersocre.js.

Requirements
------------

[](#requirements)

- PHP 5.4 or higher
- [Composer](http://getcomposer.org/)

Licence
-------

[](#licence)

MIT Licence

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

[](#getting-started)

1. Install [Composer](http://getcomposer.org/).
2. Create the `composer.json`
3. Execute `composer.phar install`

**composer.json**

```
{
    "require": {
        "emonkak/underbar.php": "dev-master"
    }
}
```

Example
-------

[](#example)

```
// There are also ArrayImpl and GeneratorImpl.
use Underbar\IteratorImpl as _;

// Take five elements from a infinite list of even numbers.
_::chain(0)
    ->iterate(function($n) { return $n + 1; })
    ->filter(function($n) { return $n % 2 === 0; })
    ->take(5)
    ->each(function($n) { echo $n, PHP_EOL; });
// => 0
//    2
//    4
//    6
//    8

// Get a first element.
echo _::first(array(100)), PHP_EOL;
// => 100
```

API Reference
-------------

[](#api-reference)

See

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.5% 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 ~11 days

Recently: every ~17 days

Total

8

Last Release

4651d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.3.0

0.2.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/482d690ac653e05c9f5625e0f5f6e71b55e77646ab722bbcfdfbd26bf3c8d86b?d=identicon)[emonkak](/maintainers/emonkak)

---

Top Contributors

[![emonkak](https://avatars.githubusercontent.com/u/188621?v=4)](https://github.com/emonkak "emonkak (399 commits)")[![genzouw](https://avatars.githubusercontent.com/u/29957?v=4)](https://github.com/genzouw "genzouw (1 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (1 commits)")

---

Tags

arraygeneratoriteratorcollection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emonkak-underbarphp/health.svg)

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

###  Alternatives

[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4581.2M5](/packages/athari-yalinqo)[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

745762.4k16](/packages/loophp-collection)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.3k459.4k15](/packages/aimeos-map)[nikic/iter

Iteration primitives using generators

1.1k6.4M55](/packages/nikic-iter)[ginq/ginq

LINQ to Object inspired DSL for PHP

192258.5k3](/packages/ginq-ginq)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.4

222.7M3](/packages/chdemko-sorted-collections)

PHPackages © 2026

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