3v4l.org

run code in 300+ PHP versions simultaneously
<?php function showCombinations($string, $traits, $i) { if ($i >= count($traits)) echo trim($string); else { foreach ($traits[$i] as $trait) showCombinations("$string $trait", $traits, $i + 1); } } $sec="-"; $brk="<br>"; $traits = array ( array('290', '679','689','149','347','690','169','790','890', '260','567','568','100','147','200','148','300', '400','168','240','600','250','700','279','800', '270','900','280','380','246','248','249','259', '269','360','470','480','228','229','220', '258','122','268','369','224','144','460','226', '255','680','266','188','468','233','244', '128','129','120','140','123','448','124','223', '125','288','225','127','299','236','344','238', '445','446','230','366','466','160','440', '180','145','245','660','256','455','447','278', '477','234','488','588','345','688','346','699','349','880', '340','189','289','235','668','678','669', '490','788','789','456','889','367','899', '458','566','450','667','389','677','589', '670','780','457','467','478','569',), array($sec), array('290','138','679','139','689','149','347','159','690', '169','790','179','890','567','135','136','578', '158','250','279','270','550','119','110','112', '249','113','259','114','269','115','350','116', '370','118','155','247','229','257','277','133', '579','227','570','255','337','357','358','330', '233','469','199','479','335','129','336','355', '239','338','123','223','125','225','299','236', '156','499','445','356','230','150','377', '134','145','334','245','237','256','599','590', '455','267','447','178','556','449','170','477', '234','559','190','489','345','779','130','699', '799','557','189','558','289','577','235','678', '669','390','778','789','770','456','889','367', '899','458','378','990','667','677','589', '670','457','467','459','478','569',), array($brk), ); showCombinations('', $traits, 0); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LFtdK
function name:  (null)
number of ops:  15
compiled vars:  !0 = $sec, !1 = $brk, !2 = $traits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, '-'
   13     1        ASSIGN                                                   !1, '%3Cbr%3E'
   15     2        INIT_ARRAY                                       ~5      <array>
   32     3        INIT_ARRAY                                       ~6      !0
          4        ADD_ARRAY_ELEMENT                                ~5      ~6
   15     5        ADD_ARRAY_ELEMENT                                ~5      <array>
   49     6        INIT_ARRAY                                       ~7      !1
          7        ADD_ARRAY_ELEMENT                                ~5      ~7
   14     8        ASSIGN                                                   !2, ~5
   52     9        INIT_FCALL                                               'showcombinations'
         10        SEND_VAL                                                 ''
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        DO_FCALL                                      0          
   53    14      > RETURN                                                   1

Function showcombinations:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/LFtdK
function name:  showCombinations
number of ops:  26
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, ->11
    5     6    >   INIT_FCALL                                               'trim'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ECHO                                                     $6
         10      > JMP                                                      ->25
    8    11    >   FETCH_DIM_R                                      ~7      !1, !2
         12      > FE_RESET_R                                       $8      ~7, ->24
         13    > > FE_FETCH_R                                               $8, !3, ->24
    9    14    >   INIT_FCALL_BY_NAME                                       'showCombinations'
         15        ROPE_INIT                                     3  ~10     !0
         16        ROPE_ADD                                      1  ~10     ~10, '+'
         17        ROPE_END                                      2  ~9      ~10, !3
         18        SEND_VAL_EX                                              ~9
         19        SEND_VAR_EX                                              !1
         20        ADD                                              ~12     !2, 1
         21        SEND_VAL_EX                                              ~12
         22        DO_FCALL                                      0          
    8    23      > JMP                                                      ->13
         24    >   FE_FREE                                                  $8
   11    25    > > RETURN                                                   null

End of function showcombinations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.68 ms | 1403 KiB | 16 Q