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=0; $val = array(""); function makeCombinations($array,$values){ foreach($array as $value) { if(is_array($value)) makeCombinations($value,$values); else { $val[$values] = $values; $values++; } } } makeCombinations($array,$values); print_r($val); //echo $values;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XeX9f
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $values, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
    4     2        ASSIGN                                                   !2, <array>
   17     3        INIT_FCALL                                               'makecombinations'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0          
   18     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   19    10      > RETURN                                                   1

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

End of function makecombinations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.63 ms | 1390 KiB | 16 Q