3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; for($i=1; $i<=10000;$i++) { $rand = random_int(1, 200); if ($rand <= 2) $a++; } echo $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 3
Branch analysis from position: 14
Branch analysis from position: 3
Branch analysis from position: 11
filename:       /in/GVVUR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $i, !2 = $rand
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->12
    5     3    >   INIT_FCALL                                               'random_int'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 200
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
    6     8        IS_SMALLER_OR_EQUAL                                      !2, 2
          9      > JMPZ                                                     ~7, ->11
    7    10    >   PRE_INC                                                  !0
    4    11    >   PRE_INC                                                  !1
         12    >   IS_SMALLER_OR_EQUAL                                      !1, 10000
         13      > JMPNZ                                                    ~10, ->3
    9    14    >   ECHO                                                     !0
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.9 ms | 1395 KiB | 15 Q