PHPackages                             akamon/phunctional - 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. akamon/phunctional

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

akamon/phunctional
==================

λ PHP functional library

v2.1.0(5y ago)3609.4k36[1 issues](https://github.com/Lambdish/phunctional/issues)[1 PRs](https://github.com/Lambdish/phunctional/pulls)MITPHPPHP &gt;=7.2

Since Feb 24Pushed 2y ago23 watchersCompare

[ Source](https://github.com/Lambdish/phunctional)[ Packagist](https://packagist.org/packages/akamon/phunctional)[ RSS](/packages/akamon-phunctional/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (21)Used By (0)

[![](https://cloud.githubusercontent.com/assets/1331435/18451701/4888ff86-7938-11e6-8433-1fcaf668a625.jpg)](https://cloud.githubusercontent.com/assets/1331435/18451701/4888ff86-7938-11e6-8433-1fcaf668a625.jpg)

![]()

> Phunctional, because functional programming matters.

[![Lambdish](https://camo.githubusercontent.com/29cee40166ad3cf1d63d865fc169875d5035d9e9703880ad773c7f0a778dee77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616d62646973682d7068756e6374696f6e616c2d7265642e7376673f7374796c653d666c61742d737175617265)](https://github.com/Lambdish) [![MIT License](https://camo.githubusercontent.com/48593de0035d3aebc555d81be22bb1136d0741866cc69614fd437cacc7553cf7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3030374543372e7376673f7374796c653d666c61742d737175617265)](http://opensource.org/licenses/MIT) [![Version](https://camo.githubusercontent.com/b5e0a28fe85d9f045a7cbe51e999f3e3ef0cab8dfc5afa24cb2f34ac99c81b4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c616d62646973682f7068756e6374696f6e616c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Lambdish/phunctional/releases) [![Monthly Downloads](https://camo.githubusercontent.com/bfce88dc3831dd6b12a341f9c5758e6449a33278e8881b1fda228a521380d0c3/68747470733a2f2f706f7365722e707567782e6f72672f6c616d62646973682f7068756e6374696f6e616c2f642f6d6f6e74686c79)](https://packagist.org/packages/lambdish/phunctional) [![Travis Build Status](https://camo.githubusercontent.com/8cd8227edde8aa651a79759aa7c4ccb4f11c7401000d9be6c3f5fd2f0dc725b8/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f4c616d62646973682f7068756e6374696f6e616c2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Lambdish/phunctional)

Lambdish's Phunctional is a little library that tries to bring to PHP some aspects of functional programing with **util high order functions** and **functions for manage iterables**.

About
-----

[](#about)

Phunctional is heavily inspired by [Clojure](https://clojure.org/) and some other PHP libraries like [iter](https://github.com/nikic/iter), [compose](https://github.com/igorw/compose) and [felpado](https://github.com/pablodip/felpado).

The main principles that we have in mind developing this library are:

- A collection can be any iterable PHP object, arrays or generators
- Favor composition vs inheritance
- Be lazy when you can
- Avoid state, state is (usually) evil!
- Simplicity over easiness
- Break the above rules if it makes sense

All of this can be resumed with a word: **Immutability**.

Installation
------------

[](#installation)

To install it with composer:

```
composer require lambdish/phunctional

```

Simple usage
------------

[](#simple-usage)

The first is to import every function you're going to use, for example:

```
use function Lambdish\phunctional\map;
```

And then you'll be able to use it:

```
map(
    function ($number) {
        return $number + 10;
    },
    [1, 2, 3, 4, 5]
);

// => [11, 12, 13, 14, 15]
```

And do something more complex like:

```
use function Lambdish\Phunctional\pipe;
use const Lambdish\Phunctional\{filter_null, reverse, first};

$lastNonNullableValue = pipe(filter_null, reverse, first);

$lastNonNullableValue(['first', null, 'other', 'last non nullable', null, null]);

// => "last non nullable"
```

Here we're using the provided constants, that acts like an alias for the functions full qualified namespace (and therefore, are `callable`).

Documentation
-------------

[](#documentation)

You can find the functions documentation [here](docs/docs.md).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~110 days

Total

20

Last Release

2065d ago

Major Versions

v0.1.6 → v1.0.02016-09-12

v1.0.9 → v2.0.02019-12-08

PHP version history (2 changes)v0.1.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5ee3793447af818e121bf7e237486463cb697508b58dac9f6946252a99d7fe0?d=identicon)[eloipoch](/maintainers/eloipoch)

---

Top Contributors

[![rgomezcasas](https://avatars.githubusercontent.com/u/1331435?v=4)](https://github.com/rgomezcasas "rgomezcasas (86 commits)")[![eloipoch](https://avatars.githubusercontent.com/u/159255?v=4)](https://github.com/eloipoch "eloipoch (54 commits)")[![jorgeavilacardenosa](https://avatars.githubusercontent.com/u/6871180?v=4)](https://github.com/jorgeavilacardenosa "jorgeavilacardenosa (14 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (5 commits)")[![JordiCabezudo](https://avatars.githubusercontent.com/u/7235354?v=4)](https://github.com/JordiCabezudo "JordiCabezudo (4 commits)")[![joaquinnavarro](https://avatars.githubusercontent.com/u/13185797?v=4)](https://github.com/joaquinnavarro "joaquinnavarro (2 commits)")[![odelrio](https://avatars.githubusercontent.com/u/3109330?v=4)](https://github.com/odelrio "odelrio (2 commits)")[![letnando](https://avatars.githubusercontent.com/u/5954976?v=4)](https://github.com/letnando "letnando (2 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (1 commits)")[![diyankk](https://avatars.githubusercontent.com/u/12828630?v=4)](https://github.com/diyankk "diyankk (1 commits)")[![ticdenis](https://avatars.githubusercontent.com/u/13036682?v=4)](https://github.com/ticdenis "ticdenis (1 commits)")[![felixgomez](https://avatars.githubusercontent.com/u/3040555?v=4)](https://github.com/felixgomez "felixgomez (1 commits)")[![fnandot](https://avatars.githubusercontent.com/u/35688033?v=4)](https://github.com/fnandot "fnandot (1 commits)")[![GMadorell](https://avatars.githubusercontent.com/u/3237803?v=4)](https://github.com/GMadorell "GMadorell (1 commits)")[![joanmasoletgo](https://avatars.githubusercontent.com/u/33221771?v=4)](https://github.com/joanmasoletgo "joanmasoletgo (1 commits)")[![joucogi](https://avatars.githubusercontent.com/u/8606896?v=4)](https://github.com/joucogi "joucogi (1 commits)")[![pfazzi](https://avatars.githubusercontent.com/u/4489261?v=4)](https://github.com/pfazzi "pfazzi (1 commits)")[![ptondereau](https://avatars.githubusercontent.com/u/4287777?v=4)](https://github.com/ptondereau "ptondereau (1 commits)")

---

Tags

functionalfunctional-programmingimmutabilitymapperformancephpphp-libraryreducephplibrarygeneratorfunctionallambda

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/akamon-phunctional/health.svg)

```
[![Health](https://phpackages.com/badges/akamon-phunctional/health.svg)](https://phpackages.com/packages/akamon-phunctional)
```

###  Alternatives

[lambdish/phunctional

λ PHP functional library

3612.0M23](/packages/lambdish-phunctional)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[transprime-research/piper

PHP Pipe method execution with values from chained method executions

174.6k2](/packages/transprime-research-piper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
