|
Ds\Deque::reduceReduces the deque to a single value using a callback function. Description
public mixed Ds\Deque::reduce
( callable
$callback
[, mixed $initial
] )Reduces the deque to a single value using a callback function. Parameters
Return ValuesThe return value of the final callback. ExamplesExample #1 Ds\Deque::reduce with initial value example
<?php The above example will output something similar to: int(30) Example #2 Ds\Deque::reduce without an initial value example
<?php The above example will output something similar to: int(21) |