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"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 10
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 19
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 10
Branch analysis from position: 47
Branch analysis from position: 10
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 19
Branch analysis from position: 30
Branch analysis from position: 19
Branch analysis from position: 27
filename:       /in/BqqSr
function name:  (null)
number of ops:  48
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        ASSIGN                                                   !0, ~10
    3     4        INIT_FCALL                                               'getrandmax'
          5        DO_ICALL                                         $12     
          6        ASSIGN                                                   !1, $12
    4     7        ASSIGN                                                   !2, 1000
    5     8        ASSIGN                                                   !3, !0
          9      > JMP                                                      ->45
    6    10    >   INIT_FCALL                                               'abs'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $16     
         13        SUB                                              ~17     !1, $16
         14        ADD                                              ~18     ~17, 1
         15        ASSIGN                                                   !4, ~18
    7    16        ASSIGN                                                   !5, 0
    8    17        ASSIGN                                                   !6, 0
         18      > JMP                                                      ->28
    9    19    >   INIT_FCALL                                               'rand'
         20        SEND_VAR                                                 !3
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $22     
         23        ASSIGN                                                   !7, $22
   10    24        IS_EQUAL                                                 !7, !4
         25      > JMPZ                                                     ~24, ->27
   11    26    >   PRE_INC                                                  !5
    8    27    >   PRE_INC                                                  !6
         28    >   IS_SMALLER                                               !6, !2
         29      > JMPNZ                                                    ~27, ->19
   13    30    >   MUL                                              ~28     !5, 100
         31        DIV                                              ~29     ~28, !2
         32        ASSIGN                                                   !8, ~29
   14    33        ROPE_INIT                                     5  ~32     'Number+%27'
         34        ROPE_ADD                                      1  ~32     ~32, !4
         35        ROPE_ADD                                      2  ~32     ~32, '%27+was+generated+'
         36        ROPE_ADD                                      3  ~32     ~32, !5
         37        ROPE_END                                      4  ~31     ~32, '+times%2C+'
         38        CONCAT                                           ~35     ~31, !8
         39        ROPE_INIT                                     3  ~37     '%25%2C+minimum+%3D+'
         40        ROPE_ADD                                      1  ~37     ~37, !3
         41        ROPE_END                                      2  ~36     ~37, '%0A'
         42        CONCAT                                           ~39     ~35, ~36
         43        ECHO                                                     ~39
    5    44        ASSIGN_OP                                     1          !3, 10000000
         45    >   IS_SMALLER                                               !3, 0
         46      > JMPNZ                                                    ~41, ->10
   15    47    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.82 ms | 1400 KiB | 19 Q