3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCombinations($traits, $string = '', $i = 0) { $combinations = ''; if ($i >= count($traits)) return trim($string) . "\n"; else { foreach ($traits[$i] as $trait) { $combinations .= getCombinations($traits, "$string $trait", $i + 1); } } if($i==0) return explode("\n",$combinations); return $combinations; } $traits = array ( array('Happy', 'Sad', 'Angry', 'Hopeful'), array('Outgoing', 'Introverted'), array('Tall', 'Short', 'Medium'), array('Handsome', 'Plain', 'Ugly') ); $combinations = getCombinations($traits); print_r($combinations);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Happy Outgoing Tall Handsome [1] => Happy Outgoing Tall Plain [2] => Happy Outgoing Tall Ugly [3] => Happy Outgoing Short Handsome [4] => Happy Outgoing Short Plain [5] => Happy Outgoing Short Ugly [6] => Happy Outgoing Medium Handsome [7] => Happy Outgoing Medium Plain [8] => Happy Outgoing Medium Ugly [9] => Happy Introverted Tall Handsome [10] => Happy Introverted Tall Plain [11] => Happy Introverted Tall Ugly [12] => Happy Introverted Short Handsome [13] => Happy Introverted Short Plain [14] => Happy Introverted Short Ugly [15] => Happy Introverted Medium Handsome [16] => Happy Introverted Medium Plain [17] => Happy Introverted Medium Ugly [18] => Sad Outgoing Tall Handsome [19] => Sad Outgoing Tall Plain [20] => Sad Outgoing Tall Ugly [21] => Sad Outgoing Short Handsome [22] => Sad Outgoing Short Plain [23] => Sad Outgoing Short Ugly [24] => Sad Outgoing Medium Handsome [25] => Sad Outgoing Medium Plain [26] => Sad Outgoing Medium Ugly [27] => Sad Introverted Tall Handsome [28] => Sad Introverted Tall Plain [29] => Sad Introverted Tall Ugly [30] => Sad Introverted Short Handsome [31] => Sad Introverted Short Plain [32] => Sad Introverted Short Ugly [33] => Sad Introverted Medium Handsome [34] => Sad Introverted Medium Plain [35] => Sad Introverted Medium Ugly [36] => Angry Outgoing Tall Handsome [37] => Angry Outgoing Tall Plain [38] => Angry Outgoing Tall Ugly [39] => Angry Outgoing Short Handsome [40] => Angry Outgoing Short Plain [41] => Angry Outgoing Short Ugly [42] => Angry Outgoing Medium Handsome [43] => Angry Outgoing Medium Plain [44] => Angry Outgoing Medium Ugly [45] => Angry Introverted Tall Handsome [46] => Angry Introverted Tall Plain [47] => Angry Introverted Tall Ugly [48] => Angry Introverted Short Handsome [49] => Angry Introverted Short Plain [50] => Angry Introverted Short Ugly [51] => Angry Introverted Medium Handsome [52] => Angry Introverted Medium Plain [53] => Angry Introverted Medium Ugly [54] => Hopeful Outgoing Tall Handsome [55] => Hopeful Outgoing Tall Plain [56] => Hopeful Outgoing Tall Ugly [57] => Hopeful Outgoing Short Handsome [58] => Hopeful Outgoing Short Plain [59] => Hopeful Outgoing Short Ugly [60] => Hopeful Outgoing Medium Handsome [61] => Hopeful Outgoing Medium Plain [62] => Hopeful Outgoing Medium Ugly [63] => Hopeful Introverted Tall Handsome [64] => Hopeful Introverted Tall Plain [65] => Hopeful Introverted Tall Ugly [66] => Hopeful Introverted Short Handsome [67] => Hopeful Introverted Short Plain [68] => Hopeful Introverted Short Ugly [69] => Hopeful Introverted Medium Handsome [70] => Hopeful Introverted Medium Plain [71] => Hopeful Introverted Medium Ugly [72] => )

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:
47.28 ms | 409 KiB | 8 Q