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=0;++$i<$range;)$c[$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(list(,$i)=each($c))$c[$i]; $r[2]+=microtime(true)-$t; } var_dump($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 10
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 34
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 47
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 10
Branch analysis from position: 64
Branch analysis from position: 10
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 47
Branch analysis from position: 55
Branch analysis from position: 47
Branch analysis from position: 34
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 16
Branch analysis from position: 21
Branch analysis from position: 16
filename:       /in/JNVcD
function name:  (null)
number of ops:  68
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                                                      ->62
    6    10    >   INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
    7    14        ASSIGN                                                   !5, 0
         15      > JMP                                                      ->18
         16    >   FETCH_DIM_R                                      ~15     !2, !5
         17        FREE                                                     ~15
         18    >   PRE_INC                                          ~16     !5
         19        IS_SMALLER                                               ~16, !1
         20      > JMPNZ                                                    ~17, ->16
    8    21    >   INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $19     
         24        SUB                                              ~20     $19, !4
         25        ASSIGN_DIM_OP                +=               1          !0, 0
         26        OP_DATA                                                  ~20
    9    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $21     
         30        ASSIGN                                                   !4, $21
   10    31      > FE_RESET_R                                       $23     !2, ->34
         32    > > FE_FETCH_R                                               $23, !5, ->34
         33    > > JMP                                                      ->32
         34    >   FE_FREE                                                  $23
   11    35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $25     
         38        SUB                                              ~26     $25, !4
         39        ASSIGN_DIM_OP                +=               1          !0, 1
         40        OP_DATA                                                  ~26
   12    41        INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $27     
         44        ASSIGN                                                   !4, $27
   13    45        ASSIGN                                                   !5, 0
   14    46      > JMP                                                      ->49
         47    >   FETCH_DIM_R                                      ~30     !2, !5
         48        FREE                                                     ~30
         49    >   INIT_FCALL_BY_NAME                                       'each'
         50        SEND_VAR_EX                                              !2
         51        DO_FCALL                                      0  $31     
         52        FETCH_LIST_R                                     $32     $31, 1
         53        ASSIGN                                                   !5, $32
         54      > JMPNZ                                                    $31, ->47
   15    55    >   INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $35     
         58        SUB                                              ~36     $35, !4
         59        ASSIGN_DIM_OP                +=               1          !0, 2
         60        OP_DATA                                                  ~36
    5    61        PRE_INC                                                  !3
         62    >   IS_SMALLER                                               !3, 10
         63      > JMPNZ                                                    ~38, ->10
   17    64    >   INIT_FCALL                                               'var_dump'
         65        SEND_VAR                                                 !0
         66        DO_ICALL                                                 
         67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.67 ms | 1400 KiB | 19 Q