3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createCombinations($input, $length) { foreach($input as $c) { if($length == 1) { echo $c; } else { foreach(createCombinations($input, $length -1) as $s) { echo $c + $s; } } } } $texte = "abcdefghijklmnopqrstuvwxyz0123456789"; $input = str_split($texte ); createCombinations($input, 4);

preferences:
30.81 ms | 402 KiB | 5 Q