3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCombinations($traits, $string = '', $i = 0) { if ($i >= count($traits)) return trim($string) . "\n"; else { foreach ($traits[$i] as $trait) return showCombinations($traits, "$string $trait", $i + 1); } } $traits = array ( array('Happy', 'Sad', 'Angry', 'Hopeful'), array('Outgoing', 'Introverted'), array('Tall', 'Short', 'Medium'), array('Handsome', 'Plain', 'Ugly') ); $combinations = getCombinations($traits); echo $combinations;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function showCombinations() in /in/dU23O:9 Stack trace: #0 /in/dU23O(21): getCombinations(Array) #1 {main} thrown in /in/dU23O on line 9
Process exited with code 255.

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