PHPackages                             withinboredom/pfa - 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. withinboredom/pfa

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

withinboredom/pfa
=================

A library for generating and using partial function application

v0.1.1(9mo ago)20[1 PRs](https://github.com/withinboredom/pfa/pulls)MITPHPPHP &gt;=8.4CI passing

Since Aug 15Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/withinboredom/pfa)[ Packagist](https://packagist.org/packages/withinboredom/pfa)[ RSS](/packages/withinboredom-pfa/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

PFA - Partial Function Application for PHP
==========================================

[](#pfa---partial-function-application-for-php)

A lightweight library for generating and using partial function application in PHP, designed to work seamlessly with PHP’s upcoming pipe operator (`|>`).

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

[](#installation)

```
composer require withinboredom/pfa
```

Requirements
------------

[](#requirements)

- PHP 8.4+

Usage
-----

[](#usage)

### Basic Partial Application

[](#basic-partial-application)

The `p()` function creates a closure that supports partial function application using placeholders:

```
