3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [ 'two' => 'a', 'three' => 'b', 'one' => 'c', ]; $keyswant = [ 'one' => '1', 'three' => '3', ]; print_r(array_intersect_key($keyswant, $array));
based on BiD8Y
Output for 5.4.12 - 7.3.1
Array ( [one] => 1 [three] => 3 )
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/ag2u7 on line 3
Process exited with code 255.