3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 10 => 'Windows', 12 => 'Keyboard', 15 => 'Monitor' ]; function map_by_key($m, $n) { return(array('id' => $m, 'name'=>$n)); } $output = array_map("map_by_key", array_keys($array),$array); print '<pre>'; print_r($output); print '</pre>'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [id] => 10 [name] => Windows ) [1] => Array ( [id] => 12 [name] => Keyboard ) [2] => Array ( [id] => 15 [name] => Monitor ) ) </pre>

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:
138.04 ms | 406 KiB | 5 Q