Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f5c01d

Browse files
committed
Use array_sum instead of default callback
1 parent b254beb commit 0f5c01d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Illuminate/Support/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ public function sum($callback = null)
623623
{
624624
if (is_null($callback))
625625
{
626-
$callback = function($item) { return $item; };
626+
return array_sum($this->items);
627627
}
628628

629629
if (is_string($callback))

0 commit comments

Comments
 (0)