Skip to content

Commit 43e0302

Browse files
committed
fix: reduce args order should be (carry, item)
1 parent 816f711 commit 43e0302

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/CollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function test_reduce_foldl_inject()
110110

111111
public function test_reduceRight_foldr()
112112
{
113-
$sum = _::_([1, 2, 3])->reduce(function ($num, $sum) {
113+
$sum = _::_([1, 2, 3])->reduce(function ($sum, $num) {
114114
return $num + $sum;
115115
}, 0);
116116

0 commit comments

Comments
 (0)