3v4l.org

run code in 300+ PHP versions simultaneously
<?php $multidim_array = ['a' => [' \one ', ['b' => 'two\\', [['c' => 'thr\ee']]]]]; $func = 'strpos'; if (function_exists($func)) { $more = true; $param2 = 'o'; array_walk_recursive($multidim_array, function(&$v)use($func, $more, $param2) { if ($more) { $v = $func($v, $param2); } else { $v = $func($v); } }); var_export($multidim_array); } else { echo "um... I'm not calling $func"; }
Output for git.master_jit, git.master, rfc.property-hooks
array ( 'a' => array ( 0 => 2, 1 => array ( 'b' => 2, 0 => array ( 0 => array ( 'c' => false, ), ), ), ), )

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