Skip to content

Commit 24272f5

Browse files
committed
fix : Fix logic error in reduceRight() method
1 parent 70c7bb3 commit 24272f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/kim/present/lib/arrayutils/ArrayUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ protected static function _reduce(array $from, callable $callback, $initialValue
802802
/** All similar to @see _reduce(), but reverse order */
803803
protected static function _reduceRight(array $from, callable $callback, $initialValue = null){
804804
$currentValue = $initialValue;
805-
foreach($from as $key => $value){
805+
foreach(array_reverse($from) as $key => $value){
806806
$currentValue = $callback($currentValue, $value, $key, $from);
807807
}
808808
return $currentValue;

0 commit comments

Comments
 (0)