hexlet/pairs-data

Lists implementation

v1.1.0 2022-01-16 12:45 UTC

This package is not auto-updated.

Last update: 2024-04-21 23:34:25 UTC


README

github action status

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)";

Hexlet Ltd. logo

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.