3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 0;$i < 100;$i++) { $array = generate(); echo "mbam_key:\n$array[0]:$array[1]\n\n"; } function generate() { $digilist = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; $id = NULL; $id.= substr($digilist, rand(1, 9), 1); $id.= substr($digilist, rand(10, 31), 1); $id.= substr($digilist, rand(10, 31), 1); $id.= substr($digilist, rand(1, 9), 1); $id.= substr($digilist, rand(1, 9), 1); $hash = md5($id); $i = 0; $key = NULL; for ($i;$i < 32;$i+= 2) { $nextdigit = hexdec(substr($hash, $i, 2)) & 31; if ((($i % 8) == 0) && ($i > 0)) { $key.= "-" . substr($digilist, $nextdigit, 1); } else { $key.= substr($digilist, $nextdigit, 1); } } $array = array($id, $key); return $array; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 2
Branch analysis from position: 16
Branch analysis from position: 2
filename:       /in/gWlXq
function name:  (null)
number of ops:  17
compiled vars:  !0 = $i, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->14
    4     2    >   INIT_FCALL_BY_NAME                                       'generate'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
    5     5        ROPE_INIT                                     5  ~8      'mbam_key%3A%0A'
          6        FETCH_DIM_R                                      ~5      !1, 0
          7        ROPE_ADD                                      1  ~8      ~8, ~5
          8        ROPE_ADD                                      2  ~8      ~8, '%3A'
          9        FETCH_DIM_R                                      ~6      !1, 1
         10        ROPE_ADD                                      3  ~8      ~8, ~6
         11        ROPE_END                                      4  ~7      ~8, '%0A%0A'
         12        ECHO                                                     ~7
    3    13        PRE_INC                                                  !0
         14    >   IS_SMALLER                                               !0, 100
         15      > JMPNZ                                                    ~12, ->2
   30    16    > > RETURN                                                   1

Function generate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 59
Branch analysis from position: 92
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
2 jumps found. (Code = 46) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 83
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 59
Branch analysis from position: 92
Branch analysis from position: 59
Branch analysis from position: 83
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 59
Branch analysis from position: 92
Branch analysis from position: 59
Branch analysis from position: 74
filename:       /in/gWlXq
function name:  generate
number of ops:  97
compiled vars:  !0 = $digilist, !1 = $id, !2 = $hash, !3 = $i, !4 = $key, !5 = $nextdigit, !6 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, '0123456789ABCDEFGHJKLMNPQRTUVWXY'
   10     1        ASSIGN                                                   !1, null
   11     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'rand'
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 9
          7        DO_ICALL                                         $9      
          8        SEND_VAR                                                 $9
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $10     
         11        ASSIGN_OP                                     8          !1, $10
   12    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        INIT_FCALL                                               'rand'
         15        SEND_VAL                                                 10
         16        SEND_VAL                                                 31
         17        DO_ICALL                                         $12     
         18        SEND_VAR                                                 $12
         19        SEND_VAL                                                 1
         20        DO_ICALL                                         $13     
         21        ASSIGN_OP                                     8          !1, $13
   13    22        INIT_FCALL                                               'substr'
         23        SEND_VAR                                                 !0
         24        INIT_FCALL                                               'rand'
         25        SEND_VAL                                                 10
         26        SEND_VAL                                                 31
         27        DO_ICALL                                         $15     
         28        SEND_VAR                                                 $15
         29        SEND_VAL                                                 1
         30        DO_ICALL                                         $16     
         31        ASSIGN_OP                                     8          !1, $16
   14    32        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !0
         34        INIT_FCALL                                               'rand'
         35        SEND_VAL                                                 1
         36        SEND_VAL                                                 9
         37        DO_ICALL                                         $18     
         38        SEND_VAR                                                 $18
         39        SEND_VAL                                                 1
         40        DO_ICALL                                         $19     
         41        ASSIGN_OP                                     8          !1, $19
   15    42        INIT_FCALL                                               'substr'
         43        SEND_VAR                                                 !0
         44        INIT_FCALL                                               'rand'
         45        SEND_VAL                                                 1
         46        SEND_VAL                                                 9
         47        DO_ICALL                                         $21     
         48        SEND_VAR                                                 $21
         49        SEND_VAL                                                 1
         50        DO_ICALL                                         $22     
         51        ASSIGN_OP                                     8          !1, $22
   16    52        INIT_FCALL                                               'md5'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                         $24     
         55        ASSIGN                                                   !2, $24
   17    56        ASSIGN                                                   !3, 0
   18    57        ASSIGN                                                   !4, null
   19    58      > JMP                                                      ->90
   20    59    >   INIT_FCALL                                               'hexdec'
         60        INIT_FCALL                                               'substr'
         61        SEND_VAR                                                 !2
         62        SEND_VAR                                                 !3
         63        SEND_VAL                                                 2
         64        DO_ICALL                                         $28     
         65        SEND_VAR                                                 $28
         66        DO_ICALL                                         $29     
         67        BW_AND                                           ~30     $29, 31
         68        ASSIGN                                                   !5, ~30
   21    69        MOD                                              ~32     !3, 8
         70        IS_EQUAL                                         ~33     ~32, 0
         71      > JMPZ_EX                                          ~33     ~33, ->74
         72    >   IS_SMALLER                                       ~34     0, !3
         73        BOOL                                             ~33     ~34
         74    > > JMPZ                                                     ~33, ->83
   22    75    >   INIT_FCALL                                               'substr'
         76        SEND_VAR                                                 !0
         77        SEND_VAR                                                 !5
         78        SEND_VAL                                                 1
         79        DO_ICALL                                         $35     
         80        CONCAT                                           ~36     '-', $35
         81        ASSIGN_OP                                     8          !4, ~36
         82      > JMP                                                      ->89
   24    83    >   INIT_FCALL                                               'substr'
         84        SEND_VAR                                                 !0
         85        SEND_VAR                                                 !5
         86        SEND_VAL                                                 1
         87        DO_ICALL                                         $38     
         88        ASSIGN_OP                                     8          !4, $38
   19    89    >   ASSIGN_OP                                     1          !3, 2
         90    >   IS_SMALLER                                               !3, 32
         91      > JMPNZ                                                    ~41, ->59
   27    92    >   INIT_ARRAY                                       ~42     !1
         93        ADD_ARRAY_ELEMENT                                ~42     !4
         94        ASSIGN                                                   !6, ~42
   28    95      > RETURN                                                   !6
   29    96*     > RETURN                                                   null

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.74 ms | 1404 KiB | 21 Q