3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createCombinations($input_str, $length) { $input = str_split($input_str); foreach($input as $c) { if($length == 1) { yield $c; return; } else { foreach(createCombinations($input_str, $length -1) as $s) { yield $c + $s; return; } } } } $texte = "abcdefghijklmnopqrstuvwxyz0123456789"; $generator = createCombinations($texte, 4); foreach($generator as $result) { echo $result; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/6Kl3N:14 Stack trace: #0 /in/6Kl3N(13): createCombinations('abcdefghijklmno...', 2) #1 /in/6Kl3N(13): createCombinations('abcdefghijklmno...', 3) #2 /in/6Kl3N(23): createCombinations('abcdefghijklmno...', 4) #3 {main} thrown in /in/6Kl3N on line 14
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:
61.89 ms | 401 KiB | 8 Q