3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = [ ['id' => 1, 'currency' => 'EUR', 'name' => 'NL'], ['id' => 2, 'currency' => 'EUR', 'name' => 'DE'], ['id' => 3, 'currency' => 'EUR', 'name' => 'FR'], ['id' => 4, 'currency' => 'EUR', 'name' => 'BE'], ['id' => 5, 'currency' => 'USD', 'name' => 'US'], ['id' => 6, 'currency' => 'Rand', 'name' => 'SAF'], ['id' => 7, 'currency' => 'Rubbles', 'name' => 'RUS'], ['id' => 8, 'currency' => 'EUR', 'name' => 'IT'], ['id' => 9, 'currency' => 'Pound', 'name' => 'GB'], ]; $query = ['currency' => 'EUR', 'id' => 8]; //search needles $out = array_filter($in, function(array $candidate) use ($query) { foreach ($query as $key => $predicate) { if (isset($candidate[$key]) && $candidate[$key] !== $predicate) { return false; } } return true; }); print_r($out);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [7] => Array ( [id] => 8 [currency] => EUR [name] => IT ) )

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