3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aggs['aggs']['name'] = "name"; function addEnd(&$item, $key) { if(is_array($item)){ return; }elseif($key=='aggs'){ $item=['name'=> ['aggs' => $item]]; }else{ $item=['aggs' => $item]; } } for($i=0; $i<5; $i++){ // your loop array_walk_recursive($aggs, 'addEnd'); } var_dump($aggs);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["aggs"]=> array(1) { ["name"]=> array(1) { ["aggs"]=> array(1) { ["name"]=> array(1) { ["aggs"]=> array(1) { ["name"]=> array(1) { ["aggs"]=> array(1) { ["name"]=> array(1) { ["aggs"]=> array(1) { ["name"]=> array(1) { ["aggs"]=> string(4) "name" } } } } } } } } } } }

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:
57.42 ms | 406 KiB | 9 Q