Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Collection
✓ use DusanKasan\Knapsack\Collection;
Create and manipulate a collection with functional methods
use DusanKasan\Knapsack\Collection;
$collection = Collection::from([1, 2, 3, 4, 5]);
$result = $collection->filter(function($v) { return $v > 2; })
->map(function($v) { return $v * 2; })
->toArray();
// $result = [6, 8, 10]
Debug
Known issues
No known issues recorded.
Upgrade
Version history
10.0.0latest on Packagist
Audit
Dependencies
No dependency data recorded yet.