PHPackages                             escapio/php-iterables - 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. escapio/php-iterables

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

escapio/php-iterables
=====================

Utility functions for working with iterables

v2.2.2(1y ago)214.9k↓34.6%[1 PRs](https://github.com/escapio/php-iterables/pulls)MITPHPPHP ^8.2CI passing

Since Jan 17Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/escapio/php-iterables)[ Packagist](https://packagist.org/packages/escapio/php-iterables)[ RSS](/packages/escapio-php-iterables/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (15)Used By (0)

Escapio PHP-Iterables
=====================

[](#escapio-php-iterables)

Description
-----------

[](#description)

PHP-Iterables is a simple utility library for PHP to provide an easy and consistent way of using iterables, no matter which type of iterable you work on: arrays, [iterators](https://www.php.net/manual/en/class.iterator.php)or [generators](https://www.php.net/manual/en/class.generator.php).

Furthermore, it allows you to chain several iterator functions in a fluent, easier-to-read way.

Features
--------

[](#features)

Check out more detailed examples in the [examples](examples.md) file.

This library includes common functions like

- [map](examples.md#map)
- [filter](examples.md#filter)
- [reduce](examples.md#reduce)

```
$double_iterable = map($iterable_of_numbers, fn($number) => $number * 2);
```

```
$filtered_iterable = filter($iterable_of_numbers, fn($number) => $number < 5);
```

```
$iterable = function () {
    yield 1;
    yield 2;
}
toArray($iterable); // [1, 2]
```

The [iterable-Builder](examples.md#builder) allow you to combine these functions in a fluent syntax:

```
(new \Escapio\Iterables\Builder())
  ->from(['Alice', 'Bob', 'Chuck'])
  ->map(strtolower(...))
  ->filter(fn ($name) => $name !== 'chuck')
  ->loop(function ($name) {
    echo $name . PHP_EOL;
  });
  // "alice"
  // "bob"
```

Installation
------------

[](#installation)

Install with [composer](https://getcomposer.org/):

```
composer require escapio/php-iterables
```

Contributing
------------

[](#contributing)

Feel free to create feature request or report bugs via [GitHub](https://github.com/escapio/php-iterables/issues/new/choose).

If you like to contribute, make sure that all tests and code style rules are satisfied, otherwise the CI will fail.

Tests
-----

[](#tests)

Command for executing the [PHPUnit](https://phpunit.de/) tests:

```
composer test
```

### Code-Style

[](#code-style)

This library uses [PHP CS Fixer](https://cs.symfony.com/) for code formatting. Run the formatter with:

```
composer code-style:fix
```

Also see the [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md).

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md)

The changelog is managed by the composer package [marcocesarato/php-conventional-changelog](https://github.com/marcocesarato/php-conventional-changelog). There are some convenient scripts in the [composer.json](composer.json) file to update the CHANGELOG and tag the commit with the current version:

- composer release:patch
- composer release:minor
- composer release:major

License
-------

[](#license)

PHP-Iterables is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance67

Regular maintenance activity

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 70.7% 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 ~82 days

Recently: every ~87 days

Total

11

Last Release

400d ago

Major Versions

0.0.0 → 1.0.02023-01-18

v1.0.4 → v2.0.02024-04-30

PHP version history (2 changes)0.0.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f5db3c5889fb3d4b88aabe553a4b7d2e18e6ea1441725f611667c806a167e7f?d=identicon)[esc-it](/maintainers/esc-it)

---

Top Contributors

[![che-git](https://avatars.githubusercontent.com/u/20399202?v=4)](https://github.com/che-git "che-git (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![bug-tape](https://avatars.githubusercontent.com/u/23630871?v=4)](https://github.com/bug-tape "bug-tape (7 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/escapio-php-iterables/health.svg)

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

PHPackages © 2026

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