3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; for($i = 0; 9999 > $i; $i++){ $array[] = $i; } $startTimeForLoop = time(); foreach($array as $key => $value){ $foo = 'bar'; } echo 'time needed for loop: ' . time()-$startTimeForLoop; echo '<br>'; $startTimeForEnd = time(); var_dump(end($array)); echo 'time needed for end()' . time()-$startTimeForEnd;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/dVAre
function name:  (null)
number of ops:  38
compiled vars:  !0 = $array, !1 = $i, !2 = $startTimeForLoop, !3 = $value, !4 = $key, !5 = $foo, !6 = $startTimeForEnd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->6
    5     3    >   ASSIGN_DIM                                               !0
          4        OP_DATA                                                  !1
    4     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 9999
          7      > JMPNZ                                                    ~11, ->3
    8     8    >   INIT_FCALL                                               'time'
          9        DO_ICALL                                         $12     
         10        ASSIGN                                                   !2, $12
    9    11      > FE_RESET_R                                       $14     !0, ->16
         12    > > FE_FETCH_R                                       ~15     $14, !3, ->16
         13    >   ASSIGN                                                   !4, ~15
   10    14        ASSIGN                                                   !5, 'bar'
    9    15      > JMP                                                      ->12
         16    >   FE_FREE                                                  $14
   12    17        INIT_FCALL                                               'time'
         18        DO_ICALL                                         $18     
         19        SUB                                              ~19     $18, !2
         20        CONCAT                                           ~20     'time+needed+for+loop%3A+', ~19
         21        ECHO                                                     ~20
   13    22        ECHO                                                     '%3Cbr%3E'
   15    23        INIT_FCALL                                               'time'
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !6, $21
   16    26        INIT_FCALL                                               'var_dump'
         27        INIT_FCALL                                               'end'
         28        SEND_REF                                                 !0
         29        DO_ICALL                                         $23     
         30        SEND_VAR                                                 $23
         31        DO_ICALL                                                 
   17    32        INIT_FCALL                                               'time'
         33        DO_ICALL                                         $25     
         34        SUB                                              ~26     $25, !6
         35        CONCAT                                           ~27     'time+needed+for+end%28%29', ~26
         36        ECHO                                                     ~27
   18    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.03 ms | 1400 KiB | 19 Q