3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; $attackCount = 1000000; for($i = 0; $i < $attackCount; $i++) { $a1 = arsort([rand(1,6), rand(1,6), rand(1,6)]); $b1 = arsort([rand(1,6), rand(1,6)]); $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 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 4
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 4
Branch analysis from position: 48
Branch analysis from position: 4
filename:       /in/02Vra
function name:  (null)
number of ops:  53
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                                                      ->46
    6     4    >   INIT_FCALL                                               'arsort'
          5        INIT_FCALL                                               'rand'
          6        SEND_VAL                                                 1
          7        SEND_VAL                                                 6
          8        DO_ICALL                                         $8      
          9        INIT_ARRAY                                       ~9      $8
         10        INIT_FCALL                                               'rand'
         11        SEND_VAL                                                 1
         12        SEND_VAL                                                 6
         13        DO_ICALL                                         $10     
         14        ADD_ARRAY_ELEMENT                                ~9      $10
         15        INIT_FCALL                                               'rand'
         16        SEND_VAL                                                 1
         17        SEND_VAL                                                 6
         18        DO_ICALL                                         $11     
         19        ADD_ARRAY_ELEMENT                                ~9      $11
         20        SEND_VAL_EX                                              ~9
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !3, $12
    7    23        INIT_FCALL                                               'arsort'
         24        INIT_FCALL                                               'rand'
         25        SEND_VAL                                                 1
         26        SEND_VAL                                                 6
         27        DO_ICALL                                         $14     
         28        INIT_ARRAY                                       ~15     $14
         29        INIT_FCALL                                               'rand'
         30        SEND_VAL                                                 1
         31        SEND_VAL                                                 6
         32        DO_ICALL                                         $16     
         33        ADD_ARRAY_ELEMENT                                ~15     $16
         34        SEND_VAL_EX                                              ~15
         35        DO_ICALL                                         $17     
         36        ASSIGN                                                   !4, $17
    8    37        FETCH_DIM_R                                      ~19     !3, 0
         38        FETCH_DIM_R                                      ~20     !4, 0
         39        IS_SMALLER                                       ~21     ~20, ~19
         40        ASSIGN_OP                                     1          !0, ~21
    9    41        FETCH_DIM_R                                      ~23     !3, 1
         42        FETCH_DIM_R                                      ~24     !4, 1
         43        IS_SMALLER                                       ~25     ~24, ~23
         44        ASSIGN_OP                                     1          !0, ~25
    4    45        PRE_INC                                                  !2
         46    >   IS_SMALLER                                               !2, !1
         47      > JMPNZ                                                    ~28, ->4
   11    48    >   INIT_FCALL                                               'var_dump'
         49        DIV                                              ~29     !0, !1
         50        SEND_VAL                                                 ~29
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.26 ms | 1400 KiB | 19 Q