3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createCombinations($input, $length) { foreach($input as $c) { if($length == 1) { return $c; } else { foreach(createCombinations($input, $length -1) as $s) { return $c + $s; } } } } $texte = "abcdefghijklmnopqrstuvwxyz0123456789"; $input = str_split($texte ); echo createCombinations($input, 4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rn5sd
function name:  (null)
number of ops:  11
compiled vars:  !0 = $texte, !1 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, 'abcdefghijklmnopqrstuvwxyz0123456789'
   20     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   21     5        INIT_FCALL                                               'createcombinations'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 4
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Function createcombinations:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/Rn5sd
function name:  createCombinations
number of ops:  25
compiled vars:  !0 = $input, !1 = $length, !2 = $c, !3 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2      > FE_RESET_R                                       $4      !0, ->23
          3    > > FE_FETCH_R                                               $4, !2, ->23
    7     4    >   IS_EQUAL                                                 !1, 1
          5      > JMPZ                                                     ~5, ->9
    8     6    >   FE_FREE                                                  $4
          7      > RETURN                                                   !2
          8*       JMP                                                      ->22
   12     9    >   INIT_FCALL_BY_NAME                                       'createCombinations'
         10        SEND_VAR_EX                                              !0
         11        SUB                                              ~6      !1, 1
         12        SEND_VAL_EX                                              ~6
         13        DO_FCALL                                      0  $7      
         14      > FE_RESET_R                                       $8      $7, ->21
         15    > > FE_FETCH_R                                               $8, !3, ->21
   13    16    >   ADD                                              ~9      !2, !3
         17        FE_FREE                                                  $8
         18        FE_FREE                                                  $4
         19      > RETURN                                                   ~9
   12    20*       JMP                                                      ->15
         21    >   FE_FREE                                                  $8
    6    22      > JMP                                                      ->3
         23    >   FE_FREE                                                  $4
   17    24      > RETURN                                                   null

End of function createcombinations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.71 ms | 1403 KiB | 16 Q