3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blah= array(array('a'=> array('name' => 'test'), 'b' => array('name' => 'test2', 'alias' => 'blah'))); $blank = array(); function _test(&$test, &$blank) { foreach ($test as $key => $value) { if (is_array($value) === false) continue; if (isset($value['alias']) === true) { $clonedArray = array(); $clonedArray = array_merge($clonedArray, $test); unset($clonedArray[$key]['a']); $blank[$value['alias']] = $clonedArray; } if (isset($value['isalias']) === true) { $test[$key] = $blank[$value['name']]; } if (is_array($value) === true){ _test($test[$key], $blank); } } } _test($blah, $blank); var_dump($blah);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> array(2) { ["a"]=> array(1) { ["name"]=> string(4) "test" } ["b"]=> array(2) { ["name"]=> string(5) "test2" ["alias"]=> string(4) "blah" } } }

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:
75.21 ms | 401 KiB | 8 Q