PHP 中的函数式编程原语
NOTE: functional-php used to come with a C extension that implemented most of the functions natively. As the performance differences weren’t that huge compared to the maintenance cost it has been removed.
A set of functional primitives for PHP, heavily inspired by Scala’s traversable collection, Dojo’s array functions and Underscore.js
Traversable$value, $index, $collection. Strict comparison is the default but can be changedFunctional to not raise conflicts with any other extension or libraryRun the following command in your project root:
composer require lstrojny/functional-php
git clone the projectcomposer installcomposer run testsFunctional\flatten()Functional\\unique(), Functional\invoke_first(),
Functional\invoke_last() and all the discussions暂无开放 Issues,或尚未同步最近议题。