Download the PHP package outcloud/php-array-sum-callable without Composer
On this page you can find all versions of the php package outcloud/php-array-sum-callable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download outcloud/php-array-sum-callable
More information about outcloud/php-array-sum-callable
Files in outcloud/php-array-sum-callable
Download outcloud/php-array-sum-callable
More information about outcloud/php-array-sum-callable
Files in outcloud/php-array-sum-callable
Vendor outcloud
Package php-array-sum-callable
Short Description Calculates sum of elements of array given by callback function
License MIT
Package php-array-sum-callable
Short Description Calculates sum of elements of array given by callback function
License MIT
Please rate this library. Is it a good library?
Informations about the package php-array-sum-callable
php_array_sum_callable
Sums array of objects/numbets via callable function
Example usage:
Let's assume we have any object of any class with some numeric value inside. We have an array of that objects, and we have to calculate a sum of those numeric values.
Let's this be our class
we have array of items of 'Num' class
Let's use array_sum_callable to calculate sum of that numbers
Result will of course be: 6
Return Values
Returns the sum of values as an integer or float; 0 if the array is empty.
Installation
via Composer:
function will be registered in global namespace.
All versions of php-array-sum-callable with dependencies
PHP Build Version
Package Version
The package outcloud/php-array-sum-callable contains the following files
Loading the files please wait ....