PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $coll = collect([10, 1, 15, 2, 8]); [$min, $max] = $coll->reduceSpread(function($min, $max, $item) { $min = min($item, $min ?? PHP_INT_MAX); $max = max($item, $max ?? PHP_INT_MIN); return [$min, $max]; }, null, null); echo "$min $max";
Show:  
Copy Clear