ali-eltaweel / cartesian-product
PHP Iterables Cartesian Product
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ali-eltaweel/cartesian-product
Requires
- php: ^8.1
This package is auto-updated.
Last update: 2025-10-21 21:03:07 UTC
README
PHP Iterables Cartesian Product
Installation
composer require ali-eltaweel/cartesian-product
Usage
use CartesianProduct\CartesianProduct; $cp = new CartesianProduct(); $cp->add(['a', 'b', 'c']); $cp->add(['1', '2', '3']); $cp->add(['+', '-', '*']); foreach ($cp as $combination) { // ... }
With keys
use CartesianProduct\CartesianProduct; $cp = new CartesianProduct(); $cp->add(['a', 'b', 'c'], 'letter'); $cp->add(['1', '2', '3'], 'number'); $cp->add(['+', '-', '*'], 'symbol'); foreach ($cp as $combination) { // ... }