3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = [0, 0, 0, 0];for($i = 0; $i < 50; ++$i){ $k = 0; $t = microtime(true); $x = 0; for($j = 0; $j < 100; ++$j) ++$x; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100; ++$j) $x++; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100; ++$j) $x += 1; $time[$k++] += microtime(true) - $t; $t = microtime(true); $x = 0; for($j = 0; $j < 100; ++$j) $x = $x + 1; $time[$k++] += microtime(true) - $t; } echo '++$x: ', $time[0] * 1000, 'ms<br />'; echo '$x++: ', $time[1] * 1000, 'ms<br />'; echo '$x += 1: ', $time[2] * 1000, 'ms<br />'; echo '$x = $x + 1: ', $time[3] * 1000, 'ms<br />';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
2 jumps found. (Code = 44) Position 1 = 80, Position 2 = 3
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 11
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 29
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 47
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 65
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 80, Position 2 = 3
Branch analysis from position: 80
Branch analysis from position: 3
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 65
Branch analysis from position: 70
Branch analysis from position: 65
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 47
Branch analysis from position: 51
Branch analysis from position: 47
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 29
Branch analysis from position: 33
Branch analysis from position: 29
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 11
Branch analysis from position: 15
Branch analysis from position: 11
filename:       /in/MQRZK
function name:  (null)
number of ops:  101
compiled vars:  !0 = $time, !1 = $i, !2 = $k, !3 = $t, !4 = $x, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
          1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->78
    4     3    >   ASSIGN                                                   !2, 0
    5     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !3, $9
    6     8        ASSIGN                                                   !4, 0
    7     9        ASSIGN                                                   !5, 0
         10      > JMP                                                      ->13
    8    11    >   PRE_INC                                                  !4
    7    12        PRE_INC                                                  !5
         13    >   IS_SMALLER                                               !5, 100
         14      > JMPNZ                                                    ~15, ->11
    9    15    >   POST_INC                                         ~16     !2
         16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $18     
         19        SUB                                              ~19     $18, !3
         20        ASSIGN_DIM_OP                +=               1          !0, ~16
         21        OP_DATA                                                  ~19
   11    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $20     
         25        ASSIGN                                                   !3, $20
   12    26        ASSIGN                                                   !4, 0
   13    27        ASSIGN                                                   !5, 0
         28      > JMP                                                      ->31
   14    29    >   PRE_INC                                                  !4
   13    30        PRE_INC                                                  !5
         31    >   IS_SMALLER                                               !5, 100
         32      > JMPNZ                                                    ~26, ->29
   15    33    >   POST_INC                                         ~27     !2
         34        INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $29     
         37        SUB                                              ~30     $29, !3
         38        ASSIGN_DIM_OP                +=               1          !0, ~27
         39        OP_DATA                                                  ~30
   17    40        INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $31     
         43        ASSIGN                                                   !3, $31
   18    44        ASSIGN                                                   !4, 0
   19    45        ASSIGN                                                   !5, 0
         46      > JMP                                                      ->49
   20    47    >   ASSIGN_OP                                     1          !4, 1
   19    48        PRE_INC                                                  !5
         49    >   IS_SMALLER                                               !5, 100
         50      > JMPNZ                                                    ~37, ->47
   21    51    >   POST_INC                                         ~38     !2
         52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $40     
         55        SUB                                              ~41     $40, !3
         56        ASSIGN_DIM_OP                +=               1          !0, ~38
         57        OP_DATA                                                  ~41
   23    58        INIT_FCALL                                               'microtime'
         59        SEND_VAL                                                 <true>
         60        DO_ICALL                                         $42     
         61        ASSIGN                                                   !3, $42
   24    62        ASSIGN                                                   !4, 0
   25    63        ASSIGN                                                   !5, 0
         64      > JMP                                                      ->68
   26    65    >   ADD                                              ~46     !4, 1
         66        ASSIGN                                                   !4, ~46
   25    67        PRE_INC                                                  !5
         68    >   IS_SMALLER                                               !5, 100
         69      > JMPNZ                                                    ~49, ->65
   27    70    >   POST_INC                                         ~50     !2
         71        INIT_FCALL                                               'microtime'
         72        SEND_VAL                                                 <true>
         73        DO_ICALL                                         $52     
         74        SUB                                              ~53     $52, !3
         75        ASSIGN_DIM_OP                +=               1          !0, ~50
         76        OP_DATA                                                  ~53
    3    77        PRE_INC                                                  !1
         78    >   IS_SMALLER                                               !1, 50
         79      > JMPNZ                                                    ~55, ->3
   29    80    >   ECHO                                                     '%2B%2B%24x%3A+'
         81        FETCH_DIM_R                                      ~56     !0, 0
         82        MUL                                              ~57     ~56, 1000
         83        ECHO                                                     ~57
         84        ECHO                                                     'ms%3Cbr+%2F%3E'
   30    85        ECHO                                                     '%24x%2B%2B%3A+'
         86        FETCH_DIM_R                                      ~58     !0, 1
         87        MUL                                              ~59     ~58, 1000
         88        ECHO                                                     ~59
         89        ECHO                                                     'ms%3Cbr+%2F%3E'
   31    90        ECHO                                                     '%24x+%2B%3D+1%3A+'
         91        FETCH_DIM_R                                      ~60     !0, 2
         92        MUL                                              ~61     ~60, 1000
         93        ECHO                                                     ~61
         94        ECHO                                                     'ms%3Cbr+%2F%3E'
   32    95        ECHO                                                     '%24x+%3D+%24x+%2B+1%3A+'
         96        FETCH_DIM_R                                      ~62     !0, 3
         97        MUL                                              ~63     ~62, 1000
         98        ECHO                                                     ~63
         99        ECHO                                                     'ms%3Cbr+%2F%3E'
        100      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.11 ms | 1404 KiB | 15 Q