3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = generate(); echo $array[0]; echo "<br />"; echo $array[1]; echo "<br />"; echo $array[2]; echo "<br />"; echo $array[3]; echo "<br />"; echo $array[4]; // FUNCTION function generate() { $digilist = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; $ip = gethostbyname('keystone.mwbsys.com'); $long = ip2long($ip); $ipenc = md5($long); //now we generate a new random ID number using the substrings of the digitList string above $id = NULL; $id .= substr($digilist, rand(1, 4), 1); //random number ( adjust where 1,4 is lower boundary or 5,9 is higher boundary) $id .= substr($digilist, rand(10, 20), 1); //then a letter $id .= substr($digilist, rand(21, 31), 1); //another letter $id .= substr($digilist, rand(5, 9), 1); //a number ( adjust where 5,9 is higher boundary or 1,4 is lower boundary) $id .= substr($long, rand(1, 9), 1); //and finally another number ( you can adjust this to high or low) // note in $id if start with high-low-high-low or vice versa combination //ok so now we need to generate an MD5 hash of our ID $st = md5('Licensed'); $duration = md5('Lifetime'); $hash = md5($id); //cycle through the hash 16 (length of key) times (in steps of 2 because each hex bytes is 2 digits long) $i = 0; $key = ""; for ($i; $i < 32; $i+=2) { //here we convert the next hex value to an integer and perform a bitwise AND operation against '31' //31 is the highest substring value in our digit list. $nextdigit = hexdec(substr($hash, $i, 2)) & 31; //if 'i' is divisable by 8 (every 4 cycles) then we want to add "-" if ((($i % 8) == 0) && ($i > 0)) { $key .= "-".substr($digilist, $nextdigit,1); } else { $key .= substr($digilist, $nextdigit, 1); } } $array = array($id, $key, $st, $duration, $long); //return return $array; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q0ppa
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'generate'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    3     3        FETCH_DIM_R                                      ~3      !0, 0
          4        ECHO                                                     ~3
    4     5        ECHO                                                     '%3Cbr+%2F%3E'
    5     6        FETCH_DIM_R                                      ~4      !0, 1
          7        ECHO                                                     ~4
    6     8        ECHO                                                     '%3Cbr+%2F%3E'
    7     9        FETCH_DIM_R                                      ~5      !0, 2
         10        ECHO                                                     ~5
    8    11        ECHO                                                     '%3Cbr+%2F%3E'
    9    12        FETCH_DIM_R                                      ~6      !0, 3
         13        ECHO                                                     ~6
   10    14        ECHO                                                     '%3Cbr+%2F%3E'
   11    15        FETCH_DIM_R                                      ~7      !0, 4
         16        ECHO                                                     ~7
   62    17      > RETURN                                                   1

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

End of function generate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.31 ms | 1408 KiB | 25 Q