3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tries = 100000; $arr = array(1,2,3); $start = microtime(true); for ($i = 0; $i < $tries; $i++) { $test = $arr[0]; } echo (microtime(true) - $start)."\n"; $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 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
Branch analysis from position: 25
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/juBN2
function name:  (null)
number of ops:  38
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, 100000
    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, 0
          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        CONCAT                                           ~16     ~15, '%0A'
         18        ECHO                                                     ~16
   10    19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !2, $17
   11    23        ASSIGN                                                   !3, 0
         24      > JMP                                                      ->30
   12    25    >   INIT_FCALL                                               'current'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !4, $20
   11    29        PRE_INC                                                  !3
         30    >   IS_SMALLER                                               !3, !0
         31      > JMPNZ                                                    ~23, ->25
   14    32    >   INIT_FCALL                                               'microtime'
         33        SEND_VAL                                                 <true>
         34        DO_ICALL                                         $24     
         35        SUB                                              ~25     $24, !2
         36        ECHO                                                     ~25
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.32 ms | 1400 KiB | 17 Q