百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

functional-php

> 编程语言
开源

PHP 中的函数式编程原语

2.0K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

PHP 中的函数式编程原语

Functional PHP: Functional primitives for 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

  • Works with arrays and everything implementing interface Traversable
  • Consistent interface: for functions taking collections and callbacks, first parameter is always the collection, then the callback. Callbacks are always passed $value, $index, $collection. Strict comparison is the default but can be changed
  • Calls 5.3 closures as well as usual callbacks
  • All functions reside in namespace Functional to not raise conflicts with any other extension or library

Installation

Run the following command in your project root:

composer require lstrojny/functional-php

Docs

Read the docs

Contributing

  1. Fork and git clone the project
  2. Install dependencies via composer install
  3. Run the tests via composer run tests
  4. Write code and create a PR

Mailing lists

  • General help and development list: http://groups.google.com/group/functional-php
  • Commit list: http://groups.google.com/group/functional-php-commits

Thank you

  • Richard Quadling and Pierre Joye for Windows build help
  • David Soria Parra for various ideas and the userland version of Functional\flatten()
  • Max Beutel for Functional\\unique(), Functional\invoke_first(), Functional\invoke_last() and all the discussions
  • An Phan for many great contributions

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Works with arrays and everything implementing interface Traversable
  • •Consistent interface: for functions taking collections and callbacks, first parameter is always the collection, then the callback.
  • •Calls 5.3 closures as well as usual callbacks
  • •All functions reside in namespace Functional to not raise conflicts with any other extension or library
  • •General help and development list: http://groups.google.com/group/functional-php
  • •Commit list: http://groups.google.com/group/functional-php-commits
  • •Richard Quadling and Pierre Joye for Windows build
  • •David Soria Parra for various ideas and the userland version of Functional\flatten()
  • •Max Beutel for Functional\\\unique(), Functional\invoke_first(),
  • •An Phan for many

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言