3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array("test"=>"1", "test2"=>2, "test3"=>3); $needed = array("test", "test2"); $a = array_filter(array($a, $needed), function ($item, $needed) { return in_array($item, $needed); });
based on FnVQX