3v4l.org

run code in 300+ PHP versions simultaneously
<?php function showCombinations($string, $traits, $i) { if ($i >= count($traits)) echo trim($string) . "\n"; else { foreach ($traits[$i] as $trait) showCombinations("$string $trait", $traits, $i + 1); } } $traits = array ( array('Happy', 'Sad', 'Angry', 'Hopeful'), array('Outgoing', 'Introverted'), array('Tall', 'Short', 'Medium'), array('Handsome', 'Plain', 'Ugly') ); showCombinations('', $traits, 0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IQdSL
function name:  (null)
number of ops:  7
compiled vars:  !0 = $traits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'showcombinations'
          2        SEND_VAL                                                 ''
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function showcombinations:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/IQdSL
function name:  showCombinations
number of ops:  27
compiled vars:  !0 = $string, !1 = $traits, !2 = $i, !3 = $trait
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        COUNT                                            ~4      !1
          4        IS_SMALLER_OR_EQUAL                                      ~4, !2
          5      > JMPZ                                                     ~5, ->12
    5     6    >   INIT_FCALL                                               'trim'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
         11      > JMP                                                      ->26
    8    12    >   FETCH_DIM_R                                      ~8      !1, !2
         13      > FE_RESET_R                                       $9      ~8, ->25
         14    > > FE_FETCH_R                                               $9, !3, ->25
    9    15    >   INIT_FCALL_BY_NAME                                       'showCombinations'
         16        ROPE_INIT                                     3  ~11     !0
         17        ROPE_ADD                                      1  ~11     ~11, '+'
         18        ROPE_END                                      2  ~10     ~11, !3
         19        SEND_VAL_EX                                              ~10
         20        SEND_VAR_EX                                              !1
         21        ADD                                              ~13     !2, 1
         22        SEND_VAL_EX                                              ~13
         23        DO_FCALL                                      0          
    8    24      > JMP                                                      ->14
         25    >   FE_FREE                                                  $9
   11    26    > > RETURN                                                   null

End of function showcombinations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.38 ms | 1407 KiB | 16 Q