3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rand_min = -getrandmax (); $rand_max = getrandmax (); $c = 1000; for ( $min = $rand_min; $min < 0; $min+=10000000 ) { $diff = $rand_max - abs ( $min ) + 1; $cnt = 0; for ( $i = 0; $i < $c; $i++ ) { $super_random_value = rand ( $min, $rand_max ); if ( $super_random_value == $diff ) $cnt++; } $per = $cnt * 100 / $c; echo "Number '${diff}' was generated ${cnt} times, " . $per . "%, minimum = ${min}\n"; }
based on kocal
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 10
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 19
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 10
Branch analysis from position: 49
Branch analysis from position: 10
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 19
Branch analysis from position: 32
Branch analysis from position: 19
Branch analysis from position: 28
filename:       /in/BqqSr
function name:  (null)
number of ops:  50
compiled vars:  !0 = $rand_min, !1 = $rand_max, !2 = $c, !3 = $min, !4 = $diff, !5 = $cnt, !6 = $i, !7 = $super_random_value, !8 = $per
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'getrandmax'
         1        DO_ICALL                                         $9      
         2        MUL                                              ~10     $9, -1
         3        QM_ASSIGN                                                !0
   3     4        INIT_FCALL                                               'getrandmax'
         5        DO_ICALL                                         $12     
         6        QM_ASSIGN                                                !1
   4     7        QM_ASSIGN                                                !2
   5     8        QM_ASSIGN                                                !3
         9      > JMP                                                      ->47
   6    10    >   INIT_FCALL                                               'abs'
        11        SEND_VAR                                                 !3
        12        DO_ICALL                                         $16     
        13        SUB                                              ~17     !1, $16
        14        ADD                                              ~18     ~17, 1
        15        QM_ASSIGN                                                !4
   7    16        QM_ASSIGN                                                !5
   8    17        QM_ASSIGN                                                !6
        18      > JMP                                                      ->30
   9    19    >   INIT_FCALL                                               'rand'
        20        SEND_VAR                                                 !3
        21        SEND_VAR                                                 !1
        22        DO_ICALL                                         $22     
        23        QM_ASSIGN                                                !7
  10    24        IS_NOT_EQUAL                                     ~24     !7, !4
        25      > JMPZ                                                     ~24, ->28
  11    26    >   POST_INC                                         ~25     !5
        27        FREE                                                     ~25
   8    28    >   POST_INC                                         ~26     !6
        29        FREE                                                     ~26
        30    >   IS_SMALLER_OR_EQUAL                              ~27     !6, !2
        31      > JMPNZ                                                    ~27, ->19
  13    32    >   MUL                                              ~28     !5, 100
        33        DIV                                              ~29     ~28, !2
        34        QM_ASSIGN                                                !8
  14    35        ROPE_INIT                                     5  ~32     'Number+%27'
        36        ROPE_ADD                                      1  ~32     ~32, !4
        37        ROPE_ADD                                      2  ~32     ~32, '%27+was+generated+'
        38        ROPE_ADD                                      3  ~32     ~32, !5
        39        ROPE_END                                      4  ~31     ~32, '+times%2C+'
        40        CONCAT                                           ~35     ~31, !8
        41        ROPE_INIT                                     3  ~37     '%25%2C+minimum+%3D+'
        42        ROPE_ADD                                      1  ~37     ~37, !3
        43        ROPE_END                                      2  ~36     ~37, '%0A'
        44        CONCAT                                           ~39     ~35, ~36
        45        ASSIGN_OBJ                                               ~39
   5    46        ASSIGN_DIV                                    1          !3, 10000000
        47    >   IS_SMALLER_OR_EQUAL                              ~41     !3, 0
        48      > JMPNZ                                                    ~41, ->10
  15    49    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.4.0