3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "one" => "one", "two" => "two", "group1" => [ "three" => "three", "four" => "four", "group2" => [ "five" => "five", ], ], "group3" => [ "six" => "six", ] ]; function mergeRecursive(array $array, $result = []) { foreach($array as $k => $v) { if(!is_array($v)) $result[] = $v; else $result[] = "$k," . mergeRecursive($v, $result); } return $result; } $result = mergeRecursive($arr); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/jiHg5 on line 27 Warning: Array to string conversion in /in/jiHg5 on line 27 Warning: Array to string conversion in /in/jiHg5 on line 27 Array ( [0] => one [1] => two [2] => group1,Array [3] => group3,Array )

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:
68.77 ms | 402 KiB | 8 Q