joelharkes / data-structures
Data structures for PHP
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/joelharkes/data-structures
Requires (Dev)
- phpstan/phpstan: ^1.8
- phpunit/phpunit: ^9
README
Data structures for PHP written in PHP.
Goal is to provide useful chainable methods for standard data structures, with a balance between as much type safety as possible and ease of use.
- Stack
- StackedList
- Set (HashSet)
- Collection (php array, similar to HashMap, Dictionary)
Iterator chaining
All iterators have been extended to chaining and delayed execution.
$set = new \DataStructures\Set\Set(); $set->getIterator() ->filter(fn($value) => $value === 1) ->map(fn($value) => $value === 1) ->count(); // or all(), any().