3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_entropy() { $ip = $_SERVER['REMOTE_ADDR']; $ip_multiplex = multiply_ip($ip); echo "IP Multiplex: $ip_multiplex | "; 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); //$openssl_num = $openssl_num / $ip_multiplex; echo "openssl: $openssl_num | "; } if(function_exists('random_bytes')) { $i = time(); $i = ($i % 8); if($i == 0) { $i = 3; } $rand_num = random_bytes($i); $rand_num = bindec($rand_num); echo "Rand Num: $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; echo "MT Rand Num: $mt_rand_num " . PHP_EOL; } return (float) $ip_multiplex + $openssl_num + $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/8YTJn
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   77     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 = 15, Position 2 = 37
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 61
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 85
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 85
Branch analysis from position: 49
Branch analysis from position: 61
Branch analysis from position: 37
filename:       /in/8YTJn
function name:  random_entropy
number of ops:  91
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
    8     7        ROPE_INIT                                     3  ~17     'IP+Multiplex%3A+'
          8        ROPE_ADD                                      1  ~17     ~17, !1
          9        ROPE_END                                      2  ~16     ~17, '+%7C+'
         10        ECHO                                                     ~16
   10    11        INIT_FCALL                                               'function_exists'
         12        SEND_VAL                                                 'openssl_random_pseudo_bytes'
         13        DO_ICALL                                         $19     
         14      > JMPZ                                                     $19, ->37
   12    15    >   INIT_FCALL                                               'time'
         16        DO_ICALL                                         $20     
         17        ASSIGN                                                   !2, $20
   13    18        MOD                                              ~22     !2, 32
         19        ASSIGN                                                   !2, ~22
   14    20        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
         21        SEND_VAR_EX                                              !2
         22        SEND_VAR_EX                                              !4
         23        DO_FCALL                                      0  $24     
         24        ASSIGN                                                   !3, $24
   15    25        INIT_FCALL                                               'bin2hex'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $26     
         28        ASSIGN                                                   !5, $26
   16    29        INIT_FCALL                                               'hexdec'
         30        SEND_VAR                                                 !5
         31        DO_ICALL                                         $28     
         32        ASSIGN                                                   !6, $28
   18    33        ROPE_INIT                                     3  ~31     'openssl%3A+'
         34        ROPE_ADD                                      1  ~31     ~31, !6
         35        ROPE_END                                      2  ~30     ~31, '+%7C+'
         36        ECHO                                                     ~30
   21    37    >   INIT_FCALL                                               'function_exists'
         38        SEND_VAL                                                 'random_bytes'
         39        DO_ICALL                                         $33     
         40      > JMPZ                                                     $33, ->61
   23    41    >   INIT_FCALL                                               'time'
         42        DO_ICALL                                         $34     
         43        ASSIGN                                                   !2, $34
   24    44        MOD                                              ~36     !2, 8
         45        ASSIGN                                                   !2, ~36
   25    46        IS_EQUAL                                                 !2, 0
         47      > JMPZ                                                     ~38, ->49
   27    48    >   ASSIGN                                                   !2, 3
   30    49    >   INIT_FCALL                                               'random_bytes'
         50        SEND_VAR                                                 !2
         51        DO_ICALL                                         $40     
         52        ASSIGN                                                   !7, $40
   31    53        INIT_FCALL                                               'bindec'
         54        SEND_VAR                                                 !7
         55        DO_ICALL                                         $42     
         56        ASSIGN                                                   !7, $42
   32    57        ROPE_INIT                                     3  ~45     'Rand+Num%3A+'
         58        ROPE_ADD                                      1  ~45     ~45, !7
         59        ROPE_END                                      2  ~44     ~45, '+%7C+'
         60        ECHO                                                     ~44
   35    61    >   INIT_FCALL                                               'function_exists'
         62        SEND_VAL                                                 'mt_rand'
         63        DO_ICALL                                         $47     
         64      > JMPZ                                                     $47, ->85
   37    65    >   INIT_FCALL                                               'time'
         66        DO_ICALL                                         $48     
         67        ASSIGN                                                   !2, $48
   38    68        MOD                                              ~50     !2, 4
         69        ASSIGN                                                   !8, ~50
   39    70        MOD                                              ~52     !2, 8
         71        ASSIGN                                                   !9, ~52
   40    72        INIT_FCALL                                               'mt_rand'
         73        SEND_VAR                                                 !8
         74        SEND_VAR                                                 !9
         75        DO_ICALL                                         $54     
         76        ASSIGN                                                   !10, $54
   41    77        ADD                                              ~56     !10, !9
         78        DIV                                              ~57     ~56, !8
         79        ASSIGN                                                   !10, ~57
   42    80        ROPE_INIT                                     3  ~60     'MT+Rand+Num%3A+'
         81        ROPE_ADD                                      1  ~60     ~60, !10
         82        ROPE_END                                      2  ~59     ~60, '+'
         83        CONCAT                                           ~62     ~59, '%0A'
         84        ECHO                                                     ~62
   45    85    >   CAST                                          5  ~63     !1
         86        ADD                                              ~64     ~63, !6
         87        ADD                                              ~65     ~64, !7
         88        ADD                                              ~66     ~65, !10
         89      > RETURN                                                   ~66
   47    90*     > 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/8YTJn
function name:  microtime_float
number of ops:  16
compiled vars:  !0 = $usec, !1 = $sec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     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
   56    11        CAST                                          5  ~8      !0
         12        CAST                                          5  ~9      !1
         13        ADD                                              ~10     ~8, ~9
         14      > RETURN                                                   ~10
   57    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/8YTJn
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
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
   61     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   62     6        ASSIGN                                                   !2, 1
   64     7      > FE_RESET_R                                       $7      !1, ->17
          8    > > FE_FETCH_R                                               $7, !3, ->17
   66     9    >   IS_EQUAL                                                 !3, 0
         10      > JMPZ                                                     ~8, ->14
   68    11    >   INIT_FCALL                                               'microtime_float'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !3, $9
   71    14    >   MUL                                              ~11     !2, !3
         15        ASSIGN                                                   !2, ~11
   64    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $7
   74    18        INIT_FCALL                                               'round'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $13     
         21      > RETURN                                                   $13
   75    22*     > RETURN                                                   null

End of function multiply_ip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.2 ms | 1411 KiB | 35 Q