Calculate the product of values in the current array.

/**
 * Calculate the product of values in the current array.
 *
 * @return float|int Returns the product as an integer or float.
 */
public function product()

Examples

$result = Arrays::create([2, 2, 2])->product();

print_r($result);

The above example will output:

8

Getting Started

Methods