3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr1 = [ ['foo' => 'bar'], ['foo' => 'bit'], ['foo' => 'biz'], ['foo' => 'bat'], ['foo' => 'baz'], ]; $arr2 = ['bit','bat']; $arr3 = array_filter($arr1, function ($v) use ($arr2) { return array_search($v['foo'],$arr2) !== false; }); print_r($arr3);
based on kHTKB
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.1
Array ( [1] => Array ( [foo] => bit ) [3] => Array ( [foo] => bat ) )