3v4l.org

run code in 300+ PHP versions simultaneously
<?php // seed with microseconds function make_seed() { echo microtime(); echo '<pre>';explode(' ', microtime()); list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } mt_srand(make_seed()); $randval = mt_rand(); echo $randval;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VR8V6
function name:  (null)
number of ops:  10
compiled vars:  !0 = $randval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'mt_srand'
          1        INIT_FCALL                                               'make_seed'
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                                 
   12     5        INIT_FCALL                                               'mt_rand'
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
   13     8        ECHO                                                     !0
          9      > RETURN                                                   1

Function make_seed:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VR8V6
function name:  make_seed
number of ops:  27
compiled vars:  !0 = $usec, !1 = $sec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'microtime'
          1        DO_ICALL                                         $2      
          2        ECHO                                                     $2
    7     3        ECHO                                                     '%3Cpre%3E'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        INIT_FCALL                                               'microtime'
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '+'
         12        INIT_FCALL                                               'microtime'
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16        FETCH_LIST_R                                     $7      $6, 0
         17        ASSIGN                                                   !0, $7
         18        FETCH_LIST_R                                     $9      $6, 1
         19        ASSIGN                                                   !1, $9
         20        FREE                                                     $6
    9    21        CAST                                          5  ~11     !1
         22        CAST                                          5  ~12     !0
         23        MUL                                              ~13     ~12, 100000
         24        ADD                                              ~14     ~11, ~13
         25      > RETURN                                                   ~14
   10    26*     > RETURN                                                   null

End of function make_seed

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.01 ms | 1399 KiB | 22 Q