3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(1234); var_dump(mt_rand(100,1)); define("UL", mt_getrandmax()+1000); $r=mt_rand(0, UL); var_dump($r); if ($r < 0 || $r > UL) echo "Random value out of range\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 31
filename:       /in/TucCX
function name:  (null)
number of ops:  34
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'mt_srand'
          1        SEND_VAL                                                 1234
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'mt_rand'
          5        SEND_VAL                                                 100
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'UL'
         12        INIT_FCALL                                               'mt_getrandmax'
         13        DO_ICALL                                         $4      
         14        ADD                                              ~5      $4, 1000
         15        SEND_VAL                                                 ~5
         16        DO_ICALL                                                 
    6    17        INIT_FCALL                                               'mt_rand'
         18        SEND_VAL                                                 0
         19        FETCH_CONSTANT                                   ~7      'UL'
         20        SEND_VAL                                                 ~7
         21        DO_ICALL                                         $8      
         22        ASSIGN                                                   !0, $8
    7    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
    8    26        IS_SMALLER                                       ~11     !0, 0
         27      > JMPNZ_EX                                         ~11     ~11, ->31
         28    >   FETCH_CONSTANT                                   ~12     'UL'
         29        IS_SMALLER                                       ~13     ~12, !0
         30        BOOL                                             ~11     ~13
         31    > > JMPZ                                                     ~11, ->33
    9    32    >   ECHO                                                     'Random+value+out+of+range%0A'
         33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.47 ms | 1396 KiB | 23 Q