3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i; $i < 100; $i+=1){ $array = generate(); echo "id: $array[0]<br>key: $array[1]<br><br>"; } function generate(){ $char = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; $id = NULL; $id .= substr($char, rand(1, 9), 1); $id .= substr($char, rand(10, 31), 1); $id .= substr($char, rand(10, 31), 1); $id .= substr($char, rand(1, 9), 1); $id .= substr($char, rand(1, 9), 1); $hash = md5($id); $i = 0; $key = NULL; for ($i; $i < 32; $i+=2) { $nchar = hexdec(substr($hash, $i, 2)) & 31; if ((($i % 8) == 0) && ($i > 0)) { $key .= "-".substr($char, $nchar, 1); } else { $key .= substr($char, $nchar, 1); } } $array = array($id, $key); return $array; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 1
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 1
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 1
Branch analysis from position: 15
Branch analysis from position: 1
filename:       /in/aomYu
function name:  (null)
number of ops:  16
compiled vars:  !0 = $i, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E > > JMP                                                      ->13
    3     1    >   INIT_FCALL_BY_NAME                                       'generate'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
    4     4        ROPE_INIT                                     5  ~7      'id%3A+'
          5        FETCH_DIM_R                                      ~4      !1, 0
          6        ROPE_ADD                                      1  ~7      ~7, ~4
          7        ROPE_ADD                                      2  ~7      ~7, '%3Cbr%3Ekey%3A+'
          8        FETCH_DIM_R                                      ~5      !1, 1
          9        ROPE_ADD                                      3  ~7      ~7, ~5
         10        ROPE_END                                      4  ~6      ~7, '%3Cbr%3E%3Cbr%3E'
         11        ECHO                                                     ~6
    2    12        ASSIGN_OP                                     1          !0, 1
         13    >   IS_SMALLER                                               !0, 100
         14      > JMPNZ                                                    ~11, ->1
   37    15    > > 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/aomYu
function name:  generate
number of ops:  97
compiled vars:  !0 = $char, !1 = $id, !2 = $hash, !3 = $i, !4 = $key, !5 = $nchar, !6 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '0123456789ABCDEFGHJKLMNPQRTUVWXY'
    9     1        ASSIGN                                                   !1, null
   10     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
   11    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
   12    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
   13    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
   14    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
   18    56        ASSIGN                                                   !3, 0
   19    57        ASSIGN                                                   !4, null
   20    58      > JMP                                                      ->90
   22    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
   24    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
   26    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
   30    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
   20    89    >   ASSIGN_OP                                     1          !3, 2
         90    >   IS_SMALLER                                               !3, 32
         91      > JMPNZ                                                    ~41, ->59
   34    92    >   INIT_ARRAY                                       ~42     !1
         93        ADD_ARRAY_ELEMENT                                ~42     !4
         94        ASSIGN                                                   !6, ~42
   36    95      > RETURN                                                   !6
   37    96*     > RETURN                                                   null

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.33 ms | 1404 KiB | 21 Q