3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_map_key(Callable $callback, $array) { $return = array(); foreach ($array as $key => $value) { list($k,$v) = $callback($key, $value); $return[$k] = $v; } return $return; } function my_call_back($key, $value) { return array($value, strlen($value)); } $array = explode(" ", "PHP stands for PHP hypertext preprocessor"); $array = array_map_key('my_call_back', $array); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { ["PHP"]=> int(3) ["stands"]=> int(6) ["for"]=> int(3) ["hypertext"]=> int(9) ["preprocessor"]=> int(12) }

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