meniam / permutation
Permutation algorithm on PHP
Installs: 12 258
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/meniam/permutation
Requires
- php: >=5.4.0
 
Requires (Dev)
- php: >=5.4.0
 - phpunit/phpunit: ^6.0
 
This package is not auto-updated.
Last update: 2025-10-25 23:06:05 UTC
README
Generates all permutations for defined the number of elements
Example:
<?php $permutation = new Permutation(3); foreach ($i = 0; $i <= $permutation->count(); $i++) { var_dump($permutation->current()); // array like [0, 1, 2] or [2, 1, 0] $permutation->next(); } var_dump($permutation->getByPos('Some Unique Hash Or Integer'));