# lstrojny/functional-php

Primitives for functional programming in PHP

Repository: https://github.com/lstrojny/functional-php
Canonical: https://ross.abutalabs.com/products/functional-php
Language: PHP
License: MIT
License Family: permissive
Last push: 2026-03-21T19:34:35+00:00

## Health v2 (maintenance only)
Score: 68/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 73, release rhythm 43, longevity 100
- inputs: {"age_days": 5582, "days_push": 165, "days_rel": 165, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1984, forks 202 (observed 2026-08-28T04:06:02.049223+00:00)

## What it is
A PHP library providing functional programming primitives inspired by Scala's collections, Dojo's array functions, and Underscore.js. It offers a consistent set of functions operating on arrays and Traversable objects, all namespaced under Functional.

## Use cases
- apply map, filter, and reduce operations on PHP collections
- work with arrays and Traversable objects using a consistent functional API
- replace verbose foreach loops with functional primitives
- flatten, unique, and invoke functions on collections
- write more declarative PHP code with callbacks

## When to choose
- you want Underscore.js-style functional utilities in PHP
- you need consistent collection manipulation functions for arrays and Traversable objects
- you prefer functional style over imperative loops in PHP codebases

## When to avoid
- you need high-performance native C implementations (the C extension was removed)
- your project avoids extra dependencies and PHP's built-in array functions suffice
- you need immutable persistent data structures rather than function primitives

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, programming-languages
- platform: php
- tags: functional-programming, collections, underscore-inspired, traversable

## Member repositories
- lstrojny/functional-php (main) score 68

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:02.049223+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:03:19.628690+00:00, confidence not recorded.
  - readme: https://github.com/lstrojny/functional-php (fetched 2026-08-28T04:06:02.049223+00:00, sha 6c1c94548b90)
- Data as of 2026-08-30T08:39:29.467469+00:00.
