3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.38 ms | 1400 KiB | 17 Q