3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP 7.1.0 to 7.2.0beta2 modulo bias bug found during work on http://www.openwall.com/php_mt_seed/ mt_srand(1234567890); $total = 100000; $max = 0x66666666; $halves[0] = $halves[1] = 0; for ($i = 0; $i < $total; $i++) { $halves[mt_rand(0, $max - 1) / ($max / 2)]++; } printf("%.1f%% vs. %.1f%%\n", 100. * $halves[0] / $total, 100. * $halves[1] / $total); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
Branch analysis from position: 11
filename:       /in/kBpqh
function name:  (null)
number of ops:  35
compiled vars:  !0 = $total, !1 = $max, !2 = $halves, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'mt_srand'
          1        SEND_VAL                                                 1234567890
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, 100000
    5     4        ASSIGN                                                   !1, 1717986918
    6     5        ASSIGN_DIM                                       ~8      !2, 1
          6        OP_DATA                                                  0
          7        ASSIGN_DIM                                               !2, 0
          8        OP_DATA                                                  ~8
    7     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->21
    8    11    >   INIT_FCALL                                               'mt_rand'
         12        SEND_VAL                                                 0
         13        SUB                                              ~10     !1, 1
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                         $11     
         16        DIV                                              ~12     !1, 2
         17        DIV                                              ~13     $11, ~12
         18        FETCH_DIM_RW                                     $14     !2, ~13
         19        PRE_INC                                                  $14
    7    20        PRE_INC                                                  !3
         21    >   IS_SMALLER                                               !3, !0
         22      > JMPNZ                                                    ~17, ->11
   10    23    >   INIT_FCALL                                               'printf'
         24        SEND_VAL                                                 '%25.1f%25%25+vs.+%25.1f%25%25%0A'
         25        FETCH_DIM_R                                      ~18     !2, 0
         26        MUL                                              ~19     ~18, 100
         27        DIV                                              ~20     ~19, !0
         28        SEND_VAL                                                 ~20
         29        FETCH_DIM_R                                      ~21     !2, 1
         30        MUL                                              ~22     ~21, 100
         31        DIV                                              ~23     ~22, !0
         32        SEND_VAL                                                 ~23
         33        DO_ICALL                                                 
   11    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.16 ms | 1401 KiB | 19 Q