3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['A', 'B', 'C', 'D']; $array2 = [ ['name' => 'B', 'number' => 10], ['name' => 'D', 'number' => 20] ]; $lookup = array_column($array2, 'number', 'name'); var_export(array_map(fn($v) => $lookup[$v] ?? '', $array1));
Output for git.master_jit, git.master
array ( 0 => '', 1 => 10, 2 => '', 3 => 20, )

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:
65.65 ms | 405 KiB | 5 Q