3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ ['region' => 'a', 'name' => 'a'], ['region' => 'b', 'name' => 'b'], ['region' => 'c', 'name' => 'c'], ]; $find = 'b'; // print_r($arr[array_search($find, array_column($arr, 'region'))]); // print_r(array_values(array_filter($arr, fn($v) => $v['region'] === $find))[0]); // print_r(array_reduce($arr, function($acc, $curr) use($find) { if ($curr['region'] === $find) { $acc = $curr; } return $acc; }, []));
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [region] => b [name] => b ) Array ( [region] => b [name] => b ) Array ( [region] => b [name] => b )

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:
50.41 ms | 1398 KiB | 4 Q