PHPackages                             nolin/permutations - 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. nolin/permutations

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

nolin/permutations
==================

Generate permutations and combinations.

44PHP

Since Apr 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/aaa913121/permutations)[ Packagist](https://packagist.org/packages/nolin/permutations)[ RSS](/packages/nolin-permutations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Permutations
================

[](#php-permutations)

This PHP package provides functionalities for generating combinations and permutations. Initially inspired by [eoincampbell/combinatorics](https://github.com/eoincampbell/combinatorics), this package is an adaptation for PHP environments. While translating, some comments may have been lost; however, you can refer to the original files for those details.

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

[](#installation)

Install this package via Composer:

`composer require nolin/permutations:dev-master`

Usage
-----

[](#usage)

Once installed, you can use it in your PHP code as follows:

```
// Include the library
use Nolin\Permutations\Permutations;

// Create a permutations object with an array of elements
$permutations = new Permutations([1, 2, 3, 4, 5]);

// Iterate through the permutations
foreach ($permutations as $permutation) {
    // Perform desired actions with each permutation
    // e.g., echo/print, store in an array, etc.
}
```

Variations Feature
------------------

[](#variations-feature)

Variations have been transformed into VariationsWithRepetition and VariationsWithoutRepetition. The C# VariationsWithoutRepetition feature, originally from the source material, was not quite fitting the intended result. As a result, an upgrade has been made to the current() method.

Package Repository
------------------

[](#package-repository)

Feel free to explore the codebase, report issues, or submit pull requests. Your contributions are welcomed and appreciated.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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/4861f68229e7c5fefc7a6500e0fcb7878ffb341112645eb82a1f5ad76b5491b3?d=identicon)[nolin](/maintainers/nolin)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nolin-permutations/health.svg)

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

PHPackages © 2026

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