PHPackages                             fp4php/fp4php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fp4php/fp4php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fp4php/fp4php
=============

PHP functional programming library

v0.1.0(2y ago)836.3k↓39.7%[10 issues](https://github.com/fp4php/fp4php/issues)MITPHPPHP ^8.1

Since Sep 4Pushed 2y ago3 watchersCompare

[ Source](https://github.com/fp4php/fp4php)[ Packagist](https://packagist.org/packages/fp4php/fp4php)[ RSS](/packages/fp4php-fp4php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

fp4php
======

[](#fp4php)

Functional programming utilities for PHP.

[![psalm level](https://camo.githubusercontent.com/7e49aea3dc5eef44b64e9b6fb3c949d4b560875bed7ad8c92ef371504ae4f39b/68747470733a2f2f73686570686572642e6465762f6769746875622f6670347068702f6670347068702f6c6576656c2e737667)](https://camo.githubusercontent.com/7e49aea3dc5eef44b64e9b6fb3c949d4b560875bed7ad8c92ef371504ae4f39b/68747470733a2f2f73686570686572642e6465762f6769746875622f6670347068702f6670347068702f6c6576656c2e737667)[![psalm type coverage](https://camo.githubusercontent.com/d5c602c4939b63c062e61db46f1b56ececa2d39402eabf4ca67d51f5a59c9bad/68747470733a2f2f73686570686572642e6465762f6769746875622f6670347068702f6670347068702f636f7665726167652e737667)](https://camo.githubusercontent.com/d5c602c4939b63c062e61db46f1b56ececa2d39402eabf4ca67d51f5a59c9bad/68747470733a2f2f73686570686572642e6465762f6769746875622f6670347068702f6670347068702f636f7665726167652e737667)[![phpunit coverage](https://camo.githubusercontent.com/10efc503267f92892429f1e18e55b3080a8fc509528127ea4a2c522469ac5120/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6670347068702f6670347068702f62616467652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/10efc503267f92892429f1e18e55b3080a8fc509528127ea4a2c522469ac5120/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6670347068702f6670347068702f62616467652e7376673f6272616e63683d6d6173746572)

This library extensively uses curried functions and the pipe combinator.

If you don't like the following code:

```
self::someMethod(
    array_filter(
        array_map(
            fn ($i) => $i + 1,
            [1, 2, 3],
        ),
        fn ($i) => $i % 2 === 0,
    );
);
```

Or:

```
self::someMethod(
    ArrayList::fromIterable([/*...*/]),
        ->map(fn ($i) => $i + 1),
        ->filter(fn ($i) => $i % 2 === 0),
);
```

Then this library might interest you:

```
