library crankshaft
Iteration Utils for PHP similar to Python itertools
thumbtack/crankshaft
Iteration Utils for PHP similar to Python itertools
- Friday, June 6, 2014
- by visualmotive
- Repository
- 58 Watchers
- 8 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Crankshaft
A PHP version of Python's itertools., (*1)
Supported functions include map, filter, each, and reduce., (*2)
Basic usage:, (*3)
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., (*4)