Skip to content

letharion/functional-composable-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composable functional programming in PHP

Master branch status:

This library acts as a wrapper around several of PHP's built in array operators to provide an easy way to compose them.

Example:

<?php

require_once 'vendor/autoload.php';

use Letharion\Functional\Functional as F;

$a = [1, 2, 3, 4];

$f = new F($a);
$result = $f->walk(function(&$i) { return $i *= 2; })
  ->reduce(function($i, $j) { return $i + $j; })
  ->result();

var_dump($result);

int(20)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages