3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'A' => array(1, 2, 3, 4), 'B' => array(5, 6), 'C' => array('a', 'b', 'c')); $values=""; function makeCombinations($array,$values){ if(is_array($array)) { foreach($array as $value) { makeCombinations($value,$values); } } else { $values.=$array; echo $array."\n"; } return $values; } $values=makeCombinations($array,$values); //echo $values;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aqs8B
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array, !1 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, ''
   19     2        INIT_FCALL                                               'makecombinations'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                                   !1, $4
   20     7      > RETURN                                                   1

Function makecombinations:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aqs8B
function name:  makeCombinations
number of ops:  18
compiled vars:  !0 = $array, !1 = $values, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~3, ->13
    7     4    > > FE_RESET_R                                       $4      !0, ->11
          5    > > FE_FETCH_R                                               $4, !2, ->11
    9     6    >   INIT_FCALL_BY_NAME                                       'makeCombinations'
          7        SEND_VAR_EX                                              !2
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
    7    10      > JMP                                                      ->5
         11    >   FE_FREE                                                  $4
         12      > JMP                                                      ->16
   14    13    >   ASSIGN_OP                                     8          !1, !0
         14        CONCAT                                           ~7      !0, '%0A'
         15        ECHO                                                     ~7
   16    16    > > RETURN                                                   !1
   18    17*     > RETURN                                                   null

End of function makecombinations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.08 ms | 1399 KiB | 14 Q