3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a', 'b', 'c'); function depth_picker($arr, $temp_string, &$collect) { if ($temp_string != "") $collect []= $temp_string; for ($i=0; $i<sizeof($arr);$i++) { $arrcopy = $arr; $elem = array_splice($arrcopy, $i, 1); // removes and returns the i'th element if (sizeof($arrcopy) > 0) { depth_picker($arrcopy, $temp_string ." " . $elem[0], $collect); } else { $collect []= $temp_string. " " . $elem[0]; } } } $collect = array(); depth_picker($array, "", $collect); print_r($collect);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => a [1] => a b [2] => a b c [3] => a c [4] => a c b [5] => b [6] => b a [7] => b a c [8] => b c [9] => b c a [10] => c [11] => c a [12] => c a b [13] => c b [14] => c b a )

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