3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_entropy() { $ip = $_SERVER['REMOTE_ADDR']; $ip_multiplex = multiply_ip($ip); if(function_exists('openssl_random_pseudo_bytes')) { $i = time(); $i = ($i % 32); $bytes = openssl_random_pseudo_bytes($i, $cstrong); $hex = bin2hex($bytes); $openssl_num = hexdec($hex); } if(function_exists('random_bytes')) { $i = time(); $i = ($i % 8); $rand_num = random_bytes($i); $rand_num = bindec($rand_num); } if(function_exists('mt_rand')) { $i = time(); $i_min = ($i % 4); $i_max = ($i % 8); $mt_rand_num = mt_rand($i_min, $i_max); $mt_rand_num = ($mt_rand_num + $i_max) / $i_min; } return $ip_multiplex + $rand_num + $mt_rand_num; } function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function multiply_ip($ip) { $ip_array = explode('.', $ip); $number = 1; foreach($ip_array as $node) { if($node == 0) { $node = microtime_float(); } $number = $number * $node; } return round($number); } echo random_entropy();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WniOu
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   70     0  E >   INIT_FCALL                                               'random_entropy'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function random_entropy:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 29
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 46
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 65
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
Branch analysis from position: 46
Branch analysis from position: 29
filename:       /in/WniOu
function name:  random_entropy
number of ops:  69
compiled vars:  !0 = $ip, !1 = $ip_multiplex, !2 = $i, !3 = $bytes, !4 = $cstrong, !5 = $hex, !6 = $openssl_num, !7 = $rand_num, !8 = $i_min, !9 = $i_max, !10 = $mt_rand_num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_R                      global              ~11     '_SERVER'
          1        FETCH_DIM_R                                      ~12     ~11, 'REMOTE_ADDR'
          2        ASSIGN                                                   !0, ~12
    7     3        INIT_FCALL_BY_NAME                                       'multiply_ip'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $14     
          6        ASSIGN                                                   !1, $14
    9     7        INIT_FCALL                                               'function_exists'
          8        SEND_VAL                                                 'openssl_random_pseudo_bytes'
          9        DO_ICALL                                         $16     
         10      > JMPZ                                                     $16, ->29
   11    11    >   INIT_FCALL                                               'time'
         12        DO_ICALL                                         $17     
         13        ASSIGN                                                   !2, $17
   12    14        MOD                                              ~19     !2, 32
         15        ASSIGN                                                   !2, ~19
   13    16        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
         17        SEND_VAR_EX                                              !2
         18        SEND_VAR_EX                                              !4
         19        DO_FCALL                                      0  $21     
         20        ASSIGN                                                   !3, $21
   14    21        INIT_FCALL                                               'bin2hex'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $23     
         24        ASSIGN                                                   !5, $23
   15    25        INIT_FCALL                                               'hexdec'
         26        SEND_VAR                                                 !5
         27        DO_ICALL                                         $25     
         28        ASSIGN                                                   !6, $25
   18    29    >   INIT_FCALL                                               'function_exists'
         30        SEND_VAL                                                 'random_bytes'
         31        DO_ICALL                                         $27     
         32      > JMPZ                                                     $27, ->46
   20    33    >   INIT_FCALL                                               'time'
         34        DO_ICALL                                         $28     
         35        ASSIGN                                                   !2, $28
   21    36        MOD                                              ~30     !2, 8
         37        ASSIGN                                                   !2, ~30
   22    38        INIT_FCALL                                               'random_bytes'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                         $32     
         41        ASSIGN                                                   !7, $32
   23    42        INIT_FCALL                                               'bindec'
         43        SEND_VAR                                                 !7
         44        DO_ICALL                                         $34     
         45        ASSIGN                                                   !7, $34
   26    46    >   INIT_FCALL                                               'function_exists'
         47        SEND_VAL                                                 'mt_rand'
         48        DO_ICALL                                         $36     
         49      > JMPZ                                                     $36, ->65
   28    50    >   INIT_FCALL                                               'time'
         51        DO_ICALL                                         $37     
         52        ASSIGN                                                   !2, $37
   29    53        MOD                                              ~39     !2, 4
         54        ASSIGN                                                   !8, ~39
   30    55        MOD                                              ~41     !2, 8
         56        ASSIGN                                                   !9, ~41
   31    57        INIT_FCALL                                               'mt_rand'
         58        SEND_VAR                                                 !8
         59        SEND_VAR                                                 !9
         60        DO_ICALL                                         $43     
         61        ASSIGN                                                   !10, $43
   32    62        ADD                                              ~45     !10, !9
         63        DIV                                              ~46     ~45, !8
         64        ASSIGN                                                   !10, ~46
   35    65    >   ADD                                              ~48     !1, !7
         66        ADD                                              ~49     ~48, !10
         67      > RETURN                                                   ~49
   37    68*     > RETURN                                                   null

End of function random_entropy

Function microtime_float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WniOu
function name:  microtime_float
number of ops:  16
compiled vars:  !0 = $usec, !1 = $sec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '+'
          2        INIT_FCALL                                               'microtime'
          3        DO_ICALL                                         $2      
          4        SEND_VAR                                                 $2
          5        DO_ICALL                                         $3      
          6        FETCH_LIST_R                                     $4      $3, 0
          7        ASSIGN                                                   !0, $4
          8        FETCH_LIST_R                                     $6      $3, 1
          9        ASSIGN                                                   !1, $6
         10        FREE                                                     $3
   48    11        CAST                                          5  ~8      !0
         12        CAST                                          5  ~9      !1
         13        ADD                                              ~10     ~8, ~9
         14      > RETURN                                                   ~10
   49    15*     > RETURN                                                   null

End of function microtime_float

Function multiply_ip:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/WniOu
function name:  multiply_ip
number of ops:  23
compiled vars:  !0 = $ip, !1 = $ip_array, !2 = $number, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV                                             !0      
   53     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   54     6        ASSIGN                                                   !2, 1
   56     7      > FE_RESET_R                                       $7      !1, ->17
          8    > > FE_FETCH_R                                               $7, !3, ->17
   58     9    >   IS_EQUAL                                                 !3, 0
         10      > JMPZ                                                     ~8, ->14
   60    11    >   INIT_FCALL                                               'microtime_float'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !3, $9
   63    14    >   MUL                                              ~11     !2, !3
         15        ASSIGN                                                   !2, ~11
   56    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $7
   66    18        INIT_FCALL                                               'round'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $13     
         21      > RETURN                                                   $13
   67    22*     > RETURN                                                   null

End of function multiply_ip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.9 ms | 1407 KiB | 35 Q