jurasciix / functional
There is no license information available for the latest version (1.0.0) of this package.
1.0.0
2026-03-12 03:17 UTC
Requires
- php: ^8
Requires (Dev)
- phpunit/phpunit: ^12
This package is auto-updated.
Last update: 2026-03-12 03:32:22 UTC
README
This library introduces useful interfaces and implementations for functional programming.
For now, it includes the following interfaces:
ConsumerInterfaceBiConsumerInterfaceTriConsumerInterfaceSupplierInterfaceFunctionInterfaceBiFunctionInterfaceTriFunctionInterface
Fun fact: It fits perfectly with awurth/functional
What is wrong with PHP closures?
The short answer is: inconsistent syntax. I am willing to trade brevity for more consistent and structured code. Explicit interfaces make the purpose of each closure clear and predictable.
Disadvantages
- You cannot pass or obtain variable references.
- It is harder to bind context variables.