3v4l.org

run code in 300+ PHP versions simultaneously
<?php $loopCount = 1e6; $min = 0; $max = mt_getrandmax()*2; $res = [ 'odd' => 0, 'even'=> 0, ]; while ($loopCount--) { $v = rand($min, $max); $v%2 ? $res['odd']++ : $res['even']++; } var_dump($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 8
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 8
Branch analysis from position: 25
Branch analysis from position: 8
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 8
Branch analysis from position: 25
Branch analysis from position: 8
filename:       /in/t0q6n
function name:  (null)
number of ops:  29
compiled vars:  !0 = $loopCount, !1 = $min, !2 = $max, !3 = $res, !4 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1.0e+6
    4     1        ASSIGN                                                   !1, 0
    5     2        INIT_FCALL                                               'mt_getrandmax'
          3        DO_ICALL                                         $7      
          4        MUL                                              ~8      $7, 2
          5        ASSIGN                                                   !2, ~8
    6     6        ASSIGN                                                   !3, <array>
   10     7      > JMP                                                      ->23
   11     8    >   INIT_FCALL                                               'rand'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !4, $11
   12    13        MOD                                              ~13     !4, 2
         14      > JMPZ                                                     ~13, ->19
         15    >   FETCH_DIM_RW                                     $14     !3, 'odd'
         16        POST_INC                                         ~15     $14
         17        QM_ASSIGN                                        ~16     ~15
         18      > JMP                                                      ->22
         19    >   FETCH_DIM_RW                                     $17     !3, 'even'
         20        POST_INC                                         ~18     $17
         21        QM_ASSIGN                                        ~16     ~18
         22    >   FREE                                                     ~16
   10    23    >   POST_DEC                                         ~19     !0
         24      > JMPNZ                                                    ~19, ->8
   15    25    >   INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.05 ms | 1462 KiB | 16 Q