PHPackages                             hegland/combinatorics - 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. hegland/combinatorics

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

hegland/combinatorics
=====================

Get array / write file / iterate through all combinations of passed characters with defined length.

18PHP

Since Nov 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/rogerhegland/combinatorics)[ Packagist](https://packagist.org/packages/hegland/combinatorics)[ RSS](/packages/hegland-combinatorics/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Get array / write file / iterate through all combinations of passed characters with defined length.

Permutation
===========

[](#permutation)

With repetition
---------------

[](#with-repetition)

`// coming soon`

Without repetition
------------------

[](#without-repetition)

`// coming soon`

Variation
=========

[](#variation)

With repetition
---------------

[](#with-repetition-1)

`// coming soon`

Without repetition
------------------

[](#without-repetition-1)

`// coming soon`

Combination
===========

[](#combination)

With repetition
---------------

[](#with-repetition-2)

```
$combination = new Combination();
$combination->setCharacters('ab')->setSize(2);

$combinations = $combination->get();
// = $combinations = [ 'aa', 'ab', 'ba', 'bb' ]

$combinations = [];
while (( $combination = $combination->next() ) !== false) {
	$combinations[] = $combination;
}
// = $combinations = [ 'aa', 'ab', 'ba', 'bb' ]

$combination->write('combinations.txt', PHP_EOL);
/*
file "combinations.txt" with the following content:
aa
ab
ba
bb
*/
```

Without repetition
------------------

[](#without-repetition-2)

`// coming soon`

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/393c898cfe774fe2e62be217b533ffa405989c7154bca2f68a2f8b21f1124250?d=identicon)[rogerhegland](/maintainers/rogerhegland)

---

Top Contributors

[![rogerhegland](https://avatars.githubusercontent.com/u/10993943?v=4)](https://github.com/rogerhegland "rogerhegland (7 commits)")

### Embed Badge

![Health badge](/badges/hegland-combinatorics/health.svg)

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

PHPackages © 2026

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