3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = [0,0,0]; $range = 100000; $c = range(0,$range-1); for($a = 0;$a < 10;$a++){ $t = microtime(true); for($i = 1;++$i < $range;)$i; $r[0] += microtime(true) - $t; $t = microtime(true); foreach($c as $i)$i; $r[1] += microtime(true) - $t; $t = microtime(true); $i = 0; while(++$i < $range)$i; $r[2] += microtime(true) - $t; } var_dump($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 10
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 16
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 45
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 10
Branch analysis from position: 57
Branch analysis from position: 10
Branch analysis from position: 45
Branch analysis from position: 32
Branch analysis from position: 16
filename:       /in/8UI8f
function name:  (null)
number of ops:  61
compiled vars:  !0 = $r, !1 = $range, !2 = $c, !3 = $a, !4 = $t, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 100000
    4     2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 0
          4        SUB                                              ~8      !1, 1
          5        SEND_VAL                                                 ~8
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
    5     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->55
    6    10    >   INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
    7    14        ASSIGN                                                   !5, 1
         15      > JMP                                                      ->16
         16    >   PRE_INC                                          ~15     !5
         17        IS_SMALLER                                               ~15, !1
         18      > JMPNZ                                                    ~16, ->16
    8    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $18     
         22        SUB                                              ~19     $18, !4
         23        ASSIGN_DIM_OP                +=               1          !0, 0
         24        OP_DATA                                                  ~19
    9    25        INIT_FCALL                                               'microtime'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !4, $20
   10    29      > FE_RESET_R                                       $22     !2, ->32
         30    > > FE_FETCH_R                                               $22, !5, ->32
         31    > > JMP                                                      ->30
         32    >   FE_FREE                                                  $22
   11    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $24     
         36        SUB                                              ~25     $24, !4
         37        ASSIGN_DIM_OP                +=               1          !0, 1
         38        OP_DATA                                                  ~25
   12    39        INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $26     
         42        ASSIGN                                                   !4, $26
   13    43        ASSIGN                                                   !5, 0
   14    44      > JMP                                                      ->45
         45    >   PRE_INC                                          ~29     !5
         46        IS_SMALLER                                               ~29, !1
         47      > JMPNZ                                                    ~30, ->45
   15    48    >   INIT_FCALL                                               'microtime'
         49        SEND_VAL                                                 <true>
         50        DO_ICALL                                         $32     
         51        SUB                                              ~33     $32, !4
         52        ASSIGN_DIM_OP                +=               1          !0, 2
         53        OP_DATA                                                  ~33
    5    54        PRE_INC                                                  !3
         55    >   IS_SMALLER                                               !3, 10
         56      > JMPNZ                                                    ~35, ->10
   17    57    >   INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !0
         59        DO_ICALL                                                 
         60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.44 ms | 1400 KiB | 19 Q