PHPackages                             mckayb/phantasy - 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. mckayb/phantasy

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

mckayb/phantasy
===============

A basic functional programming library for PHP

v1.2.0(5y ago)516[4 issues](https://github.com/mckayb/phantasy/issues)MITPHPPHP &gt;=7.2.0CI failing

Since Mar 24Pushed 5y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (28)Used By (0)

Phantasy [![CircleCI](https://camo.githubusercontent.com/233a7e903495f16bce855ecf40d5c83d3098a503100c756e151229e0ca632a98/68747470733a2f2f636972636c6563692e636f6d2f67682f6d636b6179622f7068616e746173792e7376673f7374796c653d737667)](https://circleci.com/gh/mckayb/phantasy)[![Coverage Status](https://camo.githubusercontent.com/bc0a801da5c32abfc4992d718a828cb72b5100e4014e153514dbd21dc4b8151a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d636b6179622f7068616e746173792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mckayb/phantasy)
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#phantasy-)

Functional Programming Helpers and Data Types for PHP.

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

`composer require mckayb/phantasy`

### Usage

[](#usage)

```
use Phantasy\DataTypes\Maybe\Maybe;
use function Phantasy\Core\prop;

$user = [ "name" => "Foo", "email" => "foo@example.com" ];
$name = Maybe::of($user)
	->map(prop('name'))
	->getOrElse(null);
// "Foo"
```

For more information, read the [docs!](https://github.com/mckayb/phantasy/tree/master/docs)

What's Included
---------------

[](#whats-included)

- Currying, Composition, Higher-Order Functions, etc
- Maybe, Either, Reader, Writer, State, Linked List, Validation Data Types.
- More coming...

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

[](#contributing)

Find a bug? Want to make any additions? Just create an issue or open up a pull request.

Want more?
----------

[](#want-more)

For other helpers not included in this repo, check out

- [Phantasy-PHP](https://github.com/mckayb/phantasy-php)
- [Phantasy-Types](https://github.com/mckayb/phantasy-types)
- [Phantasy-Recursion-Schemes](https://github.com/mckayb/phantasy-recursion-schemes)

Inspiration
-----------

[](#inspiration)

- [Monet](https://github.com/monet/monet.js)
- [Folktale](https://github.com/origamitower/folktale)
- [Fantasy Land](https://github.com/fantasyland/fantasy-land)
- [Daggy](https://github.com/fantasyland/daggy)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance4

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~265 days

Total

24

Last Release

2036d ago

Major Versions

v0.14.2 → v1.0.02019-02-24

PHP version history (3 changes)v0.1.0PHP &gt;=7.0.0

v1.0.0PHP &gt;=7.1.0

v1.2.0PHP &gt;=7.2.0

### Community

Maintainers

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

---

Top Contributors

[![mckayb](https://avatars.githubusercontent.com/u/1355708?v=4)](https://github.com/mckayb "mckayb (201 commits)")

---

Tags

algebraic-data-typesfunctionalhacktoberfestphantasyphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mckayb-phantasy/health.svg)

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

PHPackages © 2026

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