3v4l.org

run code in 300+ PHP versions simultaneously
<?php // seed with microseconds function make_seed() { $time = microtime(); echo $time; echo '<pre>';explode(' ', $time); list($usec, $sec) = explode(' ', $time); 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/7I8s1
function name:  (null)
number of ops:  10
compiled vars:  !0 = $randval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'mt_srand'
          1        INIT_FCALL                                               'make_seed'
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'mt_rand'
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
   14     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/7I8s1
function name:  make_seed
number of ops:  24
compiled vars:  !0 = $time, !1 = $usec, !2 = $sec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'microtime'
          1        DO_ICALL                                         $3      
          2        ASSIGN                                                   !0, $3
    7     3        ECHO                                                     !0
    8     4        ECHO                                                     '%3Cpre%3E'
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '+'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    9     9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '+'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        FETCH_LIST_R                                     $7      $6, 0
         14        ASSIGN                                                   !1, $7
         15        FETCH_LIST_R                                     $9      $6, 1
         16        ASSIGN                                                   !2, $9
         17        FREE                                                     $6
   10    18        CAST                                          5  ~11     !2
         19        CAST                                          5  ~12     !1
         20        MUL                                              ~13     ~12, 100000
         21        ADD                                              ~14     ~11, ~13
         22      > RETURN                                                   ~14
   11    23*     > RETURN                                                   null

End of function make_seed

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.59 ms | 1399 KiB | 22 Q