3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [ 65 => [ ["p" => 234, "sp" => 234], [ ["p" => 53,"sp" => 5], [ ["p" => 54,"sp" => 1], ["p" => 53,"sp" => 7], ] ], [ "p" => 255, "sp" => 235 ], ] ]; function loop($array, &$coll = [], &$min = null) { foreach ($array as $key => $value) { if (is_array($value)) { loop($value, $coll, $min); } elseif ($key === "p") { if ($min === null) $min = $value; if ($min > $value) { $coll = [$array]; $min = $value; continue; } if($value === $min) $coll[] = $array; } } return $coll; } $arrays[65] = loop($arrays[65]); var_dump($arrays);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [65]=> array(2) { [0]=> array(2) { ["p"]=> int(53) ["sp"]=> int(5) } [1]=> array(2) { ["p"]=> int(53) ["sp"]=> int(7) } } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
165.78 ms | 406 KiB | 5 Q