3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; $attackCount = 1000000; for($i = 0; $i < $attackCount; $i++) { $a1 = [1,1]; arsort($a1); $b1 = [rand(1,6), rand(1,6)]; arsort($b1); $a += $a1[0] > $b1[0]; $a += $a1[1] > $b1[1]; } var_dump($a / $attackCount);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
filename:       /in/oH0SB
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $attackCount, !2 = $i, !3 = $a1, !4 = $b1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        ASSIGN                                                   !1, 1000000
    4     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->31
    6     4    >   ASSIGN                                                   !3, <array>
    7     5        INIT_FCALL                                               'arsort'
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
    8     8        INIT_FCALL                                               'rand'
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 6
         11        DO_ICALL                                         $10     
         12        INIT_ARRAY                                       ~11     $10
         13        INIT_FCALL                                               'rand'
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 6
         16        DO_ICALL                                         $12     
         17        ADD_ARRAY_ELEMENT                                ~11     $12
         18        ASSIGN                                                   !4, ~11
    9    19        INIT_FCALL                                               'arsort'
         20        SEND_REF                                                 !4
         21        DO_ICALL                                                 
   10    22        FETCH_DIM_R                                      ~15     !3, 0
         23        FETCH_DIM_R                                      ~16     !4, 0
         24        IS_SMALLER                                       ~17     ~16, ~15
         25        ASSIGN_OP                                     1          !0, ~17
   11    26        FETCH_DIM_R                                      ~19     !3, 1
         27        FETCH_DIM_R                                      ~20     !4, 1
         28        IS_SMALLER                                       ~21     ~20, ~19
         29        ASSIGN_OP                                     1          !0, ~21
    4    30        PRE_INC                                                  !2
         31    >   IS_SMALLER                                               !2, !1
         32      > JMPNZ                                                    ~24, ->4
   13    33    >   INIT_FCALL                                               'var_dump'
         34        DIV                                              ~25     !0, !1
         35        SEND_VAL                                                 ~25
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.99 ms | 1388 KiB | 19 Q