3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * * @param array $map * @param array $array * @return array */ function array_remap(array $map, array $array) { return array_combine(array_keys($map), array_map(function ($key) use ($array) { if (array_key_exists($key, $array)) { return $array[$key]; } return null; }, $map)); } var_dump(array_remap([ 'a' => 10, 'b' => 11, 'c' => 12, 'd' => 13, 'e' => 14, ], [ 10 => 'foo', 12 => 'bar', 14 => 'qux', ]));
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { ["a"]=> string(3) "foo" ["b"]=> NULL ["c"]=> string(3) "bar" ["d"]=> NULL ["e"]=> string(3) "qux" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.76 ms | 401 KiB | 8 Q