3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'two' => 'a', 'three' => 'b', 'one' => 'c', ]; $keyswant = [ 'one' => '1', 'three' => '3', ]; print_r(array_intersect_key($keyswant, $array));

preferences:
51.57 ms | 402 KiB | 5 Q