hexlet / pairs-data
Lists implementation
v1.1.0
2022-01-16 12:45 UTC
Requires
- php: >=7.4 || >=8.1
- hexlet/pairs: ^1.1
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is not auto-updated.
Last update: 2025-01-13 02:54:37 UTC
README
Functions for working with Lists.
Examples
<?php use function Php\Pairs\Data\Lists\l; use function Php\Pairs\Data\Lists\length; use function Php\Pairs\Data\Lists\filter; use function Php\Pairs\Data\Lists\toString; $list = l(1, 2, 3, 4, 5, 6); $length = length($list); // $length = 6; $filter = filter($list, fn($x) => $x % 2 == 0); $result = toString($filter); // $result = "(2, 4, 6)";
This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.
See most active contributors on hexlet-friends.