3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 146, 173 ]; $array2 = [ 'localhost' => [ '0' => ['host_id' => 146], ], '192.168.0.43' => [ '1' => [ 'host_id' => 160 ] , ], '192.168.0.38' => [ '2' => [ 'host_id' => 173 ] ] ]; $filtered_hosts = array_filter($array2, function ($x) use ($array1) { return in_array(reset($x)['host_id'], $array1); }); print_r($filtered_hosts);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [localhost] => Array ( [0] => Array ( [host_id] => 146 ) ) [192.168.0.38] => Array ( [2] => Array ( [host_id] => 173 ) ) )

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:
69.53 ms | 401 KiB | 8 Q