3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ [ 'id' => 1, 'name' => 'foo', 'blah' => 'blah' ], [ 'id' => 14, 'name' => 'bar', 'blah' => 'blah' ], [ 'id' => 4, 'name' => 'baz', 'blah' => 'blah' ], [ 'id' => 16, 'name' => 'foobar', 'blah' => 'blah' ] ]; var_dump(array_filter($records, fn(array $detail): bool => in_array($detail['id'], [14, 16])));
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
array(2) { [1]=> array(3) { ["id"]=> int(14) ["name"]=> string(3) "bar" ["blah"]=> string(4) "blah" } [3]=> array(3) { ["id"]=> int(16) ["name"]=> string(6) "foobar" ["blah"]=> string(4) "blah" } }

preferences:
95.79 ms | 407 KiB | 5 Q