PHPackages                             creatortsv/combination-iterator - 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. creatortsv/combination-iterator

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

creatortsv/combination-iterator
===============================

v1.0.3(3y ago)0655MITPHPPHP &gt;=8.1

Since Jan 14Pushed 3y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Combination Iterator
====================

[](#combination-iterator)

[![CI](https://github.com/creatortsv/combination-iterator/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/creatortsv/combination-iterator/actions/workflows/php.yml)

RequirementsPHP version`>= 8.1`Installation
------------

[](#installation)

The only thing has to be done

```
composer install creatortsv/combination-iterator
```

Usage
-----

[](#usage)

Searching for pin code combination for example

```
use Creatortsv\CombinationIterator\CombinationLengthIterator;
use Creatortsv\CombinationIterator\CombinationIterator;

$codeIterator = new CombinationIterator(
    range(0, 9),
    range(0, 9),
    range(0, 9),
    range(0, 9),
);

// The same as ...

$codeIterator = new CombinationLengthIterator(
    iterator: new CombinationIterator(range(0, 9)),
    length: 4,
);

print_r($codeIterator->count()); // prints 10000 total combinations
print_r($codeIterator->length); // prints 4

foreach ($codeIterator as $combination) {
    // Search matching of [#, #, #, #] symbols pin code ...
    //        for example [3, 5, 9, 7]
}
```

Executing some actions on each element

```
// ... use

$functions = [
    static fn (int $n) => print_r('first execution for ' . $n),
    static fn (int $n) => print_r('second execution for ' . $n),
];

foreach (new CombinationIterator([1, 2, 3], $functions) as [$number, $function]) {
    $function($number);
}

// prints ...
// first execution for 1
// second execution for 1
// the same for the 2 and 3 ...
```

It works with any iterable objects

```
$iterator = new CombinationIterator(
    new RecursiveArrayIterator([1, [2, 3], 4]),
    new MyOwnMagicIterator(),
);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.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 ~3 days

Total

4

Last Release

1211d ago

### Community

Maintainers

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

---

Top Contributors

[![creatortsv](https://avatars.githubusercontent.com/u/38066653?v=4)](https://github.com/creatortsv "creatortsv (17 commits)")[![tsaplin-v](https://avatars.githubusercontent.com/u/169811497?v=4)](https://github.com/tsaplin-v "tsaplin-v (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/creatortsv-combination-iterator/health.svg)

```
[![Health](https://phpackages.com/badges/creatortsv-combination-iterator/health.svg)](https://phpackages.com/packages/creatortsv-combination-iterator)
```

PHPackages © 2026

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