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

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

functional-php/parallel
=======================

Parallel implementation of some higher-order functions.

619[1 issues](https://github.com/functional-php/parallel/issues)PHP

Since Jan 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/functional-php/parallel)[ Packagist](https://packagist.org/packages/functional-php/parallel)[ RSS](/packages/functional-php-parallel/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Parallel
========

[](#parallel)

[![Build Status](https://camo.githubusercontent.com/299fb50d5e99389ada198e4d7f1b834e36fda3f3a6a47fd84b52841fdc6d884b/68747470733a2f2f7472617669732d63692e6f72672f66756e6374696f6e616c2d7068702f706172616c6c656c2e737667)](https://travis-ci.org/functional-php/parallel)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bb019a6f60772583276e5627560c95806aa55b461f9b8832a2f81d2d3970eeee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66756e6374696f6e616c2d7068702f706172616c6c656c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/functional-php/parallel/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/bcde4841635f890e86dac18f43004c0e7443b009c0ed4d440c5647827581aab9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66756e6374696f6e616c2d7068702f706172616c6c656c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/functional-php/parallel/?branch=master)[![Average time to resolve an issue](https://camo.githubusercontent.com/fc201f56735f98eb841f240025d2460ea673f6e023da602900a3615e44c15288/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f66756e6374696f6e616c2d7068702f706172616c6c656c2e737667)](http://isitmaintained.com/project/functional-php/parallel "Average time to resolve an issue")[![Percentage of issues still open](https://camo.githubusercontent.com/98fd2c6e48ec9cae39a374e9ffc547ed85a051a7c26f894884751a01807c53f0/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f66756e6374696f6e616c2d7068702f706172616c6c656c2e737667)](http://isitmaintained.com/project/functional-php/parallel "Percentage of issues still open")[![Chat on Gitter](https://camo.githubusercontent.com/ef03cfbbd5ec62aaabc567543aab69fdf2c97d9efb7b8374d9aa2cef00a6d912/68747470733a2f2f696d672e736869656c64732e696f2f6769747465722f726f6f6d2f67697474657248512f6769747465722e737667)](https://gitter.im/functional-php)

Parallel implementation of the higher-order functions `map`, `filter` and `fold` using the [phtreads library](https://github.com/krakjoe/pthreads). This way the computation is distributed across multiple threads so that the whole computational power of the computer can be used.

See the pthreads library requirement. If you are not sure they will be satisfied, install the [polyfill](https://github.com/krakjoe/pthreads-polyfill).

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

[](#installation)

```
composer require functional-php/parallel

```

Basic Usage
-----------

[](#basic-usage)

```
use FunctionalPHP\Parallel as p;

p\map(4, function($i) { return $i + 2; }, [1, 2, 3, 4]);
// will return [3, 4, 5, 6]

p\filter(4, function($i) { return $i % 2 == 0; }, [1, 2, 3, 4]);
// will return [2, 4]

p\fold(4, function($a, $b) { return $a + $b; }, [1, 2, 3, 4], 0);
// will return 10
```

Testing
-------

[](#testing)

You can run the test suite for the library using:

```
composer test

```

A test report will be available in the `reports` directory.

Contributing
------------

[](#contributing)

Any contribution welcome :

- Ideas
- Pull requests
- Issues

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/511338e7e9e4e1e5a7c99656dc2c746fe72c5680486c38504d244437c34555c0?d=identicon)[widmogrod](/maintainers/widmogrod)

![](https://avatars.githubusercontent.com/u/422139?v=4)[Lukáš Marek](/maintainers/krtek)[@krtek](https://github.com/krtek)

---

Top Contributors

[![krtek4](https://avatars.githubusercontent.com/u/963772?v=4)](https://github.com/krtek4 "krtek4 (5 commits)")

### Embed Badge

![Health badge](/badges/functional-php-parallel/health.svg)

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

PHPackages © 2026

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