PHPackages                             yosugi/functional-tools.php - 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. yosugi/functional-tools.php

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

yosugi/functional-tools.php
===========================

Simple functional tools for PHP

0.2.0(6y ago)317[1 PRs](https://github.com/yosugi/functional-tools.php/pulls)MITPHPPHP ^7.4CI failing

Since May 21Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/yosugi/functional-tools.php)[ Packagist](https://packagist.org/packages/yosugi/functional-tools.php)[ Docs](https://github.com/yosugi/functional-tools.php)[ RSS](/packages/yosugi-functional-toolsphp/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

functional-tools.php
====================

[](#functional-toolsphp)

Simple functional tools in PHP

Usage
-----

[](#usage)

see tests/

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

[](#installation)

```
$ composer require yosugi/functional-tools.php

```

Methods
-------

[](#methods)

### Arrays

[](#arrays)

- get(string $key, ?array $argInputArray = null) //: callable|mixed
- set(string $key, $value, ?array $argInputArray = null) //: callable|array
- flatten(?array $argInputs = null) //: callable|array
- toPairs(?array $argInputs = null) //: callable|array
- fromPairs(?array $argInputs = null) //: callable|array
- keys(?array $argInputs = null) //: callable|array
- values(?array $argInputs = null) //: callable|array
- filter(callable $predicate, ?array $argInputs = null) //: callable|array
- map(callable $fn, ?array $argInputs = null) //: callable|array
- reduce(callable $fn, $initial, ?array $argInputs = null) //: callable|mixed
- head(?array $argInputs = null) //: callable|array
- rest(?array $argInputs = null) //: callable|array
- sortBy(callable $fn, ?array $argInputs = null) //: callable|array

### Collections

[](#collections)

- filter(callable $predicate, ?iterable $argInputs = null) //: callable|array
- map(callable $fn, ?iterable $argInputs = null) //: callable|array
- reduce(callable $fn, $initial, ?iterable $argInputs = null) //: callable|mixed
- head(?iterable $argInputs = null) //: callable|array
- rest(?iterable $argInputs = null) //: callable|array
- sortBy(callable $fn, ?iterable $argInputs = null) //: callable|array

### Functions

[](#functions)

- compose(callable ...$fns): callable
- pipe(callable ...$fns): callable
- partial(callable $fn, ...$args): callable
- curry(callable $fn, ...$args): callable
- tap(...$argInputs) //: mixed

### Strings

[](#strings)

- split(string $delimiter, ?string $argInput = null) //: callable|string
- join(string $glue, ?array $argInputs = null) //: callable|string
- replace($search, $replace, ?string $argInput = null) //: callable|string
- pregReplace($pattern, $replacement, ?string $argInput = null) //: callable|string
- trim(?string $argInput = null) //: callable|string

License
-------

[](#license)

[MIT License](LICENSE)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance49

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~0 days

Total

2

Last Release

2234d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2996425?v=4)[yosugi](/maintainers/yosugi)[@yosugi](https://github.com/yosugi)

---

Top Contributors

[![yosugi](https://avatars.githubusercontent.com/u/2996425?v=4)](https://github.com/yosugi "yosugi (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yosugi-functional-toolsphp/health.svg)

```
[![Health](https://phpackages.com/badges/yosugi-functional-toolsphp/health.svg)](https://phpackages.com/packages/yosugi-functional-toolsphp)
```

###  Alternatives

[paulzi/yii2-nested-intervals

Nested Intervals Behavior for Yii2

3063.3k4](/packages/paulzi-yii2-nested-intervals)[bbrala/php7-ereg-shim

Shim for ereg functions

12104.4k](/packages/bbrala-php7-ereg-shim)

PHPackages © 2026

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