jurasciix/functional

There is no license information available for the latest version (1.0.0) of this package.

Maintainers

Package info

github.com/JuraSciix/php-functional

pkg:composer/jurasciix/functional

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-03-12 03:17 UTC

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:

  • ConsumerInterface
  • BiConsumerInterface
  • TriConsumerInterface
  • SupplierInterface
  • FunctionInterface
  • BiFunctionInterface
  • TriFunctionInterface

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.