thumbtack / crankshaft
Iteration Utils for PHP similar to Python itertools
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 55
Forks: 0
Open Issues: 0
pkg:composer/thumbtack/crankshaft
Requires (Dev)
- simpletest/simpletest: 1.1.*
This package is not auto-updated.
Last update: 2023-09-30 10:59:11 UTC
README
A PHP version of Python's itertools.
Supported functions include map
, filter
, each
, and reduce
.
Basic usage:
require_once('crankshaft.php'); $a = tt_iter([1, 2, 3]) ->map(function($x) { return 2 * x; }) ->to_array(); // $a is now [2, 4, 8]
Running Tests
This requires simpletest to be installed.