3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrObj=array(); $index=0; $startTime = microtime(true); for($i=0;$i<20000;$i++) { $arrObj[]=$i; } $endTime = microtime(true); echo $endTime-$startTime,"[]<br/>"; $arrObj2=array(); $startTime = microtime(true); for($i=0;$i<20000;$i++) { push_array($arrObj2,$i); } $endTime = microtime(true); echo $endTime-$startTime,"push<br/>"; $startTime = microtime(true); for($i=0;$i<20000;$i++) { $a=$arrObj[$index]; $index++; } $endTime = microtime(true); echo $endTime-$startTime,"[]<br/>"; $startTime = microtime(true); for($i=0;$i<20000;$i++) { $a=array_shift($arrObj2); } $endTime = microtime(true); echo $endTime-$startTime,"push<br/>"; ?>
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 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 27
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 47
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 66
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 66
Branch analysis from position: 73
Branch analysis from position: 66
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 47
Branch analysis from position: 53
Branch analysis from position: 47
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 27
Branch analysis from position: 34
Branch analysis from position: 27
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/LrdDU
function name:  (null)
number of ops:  81
compiled vars:  !0 = $arrObj, !1 = $index, !2 = $startTime, !3 = $i, !4 = $endTime, !5 = $arrObj2, !6 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    7     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
    9     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->11
   11     8    >   ASSIGN_DIM                                               !0
          9        OP_DATA                                                  !3
    9    10        PRE_INC                                                  !3
         11    >   IS_SMALLER                                               !3, 20000
         12      > JMPNZ                                                    ~14, ->8
   14    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $15     
         16        ASSIGN                                                   !4, $15
   16    17        SUB                                              ~17     !4, !2
         18        ECHO                                                     ~17
         19        ECHO                                                     '%5B%5D%3Cbr%2F%3E'
   18    20        ASSIGN                                                   !5, <array>
   20    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $19     
         24        ASSIGN                                                   !2, $19
   22    25        ASSIGN                                                   !3, 0
         26      > JMP                                                      ->32
   24    27    >   INIT_FCALL_BY_NAME                                       'push_array'
         28        SEND_VAR_EX                                              !5
         29        SEND_VAR_EX                                              !3
         30        DO_FCALL                                      0          
   22    31        PRE_INC                                                  !3
         32    >   IS_SMALLER                                               !3, 20000
         33      > JMPNZ                                                    ~24, ->27
   27    34    >   INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $25     
         37        ASSIGN                                                   !4, $25
   29    38        SUB                                              ~27     !4, !2
         39        ECHO                                                     ~27
         40        ECHO                                                     'push%3Cbr%2F%3E'
   31    41        INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $28     
         44        ASSIGN                                                   !2, $28
   33    45        ASSIGN                                                   !3, 0
         46      > JMP                                                      ->51
   35    47    >   FETCH_DIM_R                                      ~31     !0, !1
         48        ASSIGN                                                   !6, ~31
   36    49        PRE_INC                                                  !1
   33    50        PRE_INC                                                  !3
         51    >   IS_SMALLER                                               !3, 20000
         52      > JMPNZ                                                    ~35, ->47
   39    53    >   INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $36     
         56        ASSIGN                                                   !4, $36
   40    57        SUB                                              ~38     !4, !2
         58        ECHO                                                     ~38
         59        ECHO                                                     '%5B%5D%3Cbr%2F%3E'
   43    60        INIT_FCALL                                               'microtime'
         61        SEND_VAL                                                 <true>
         62        DO_ICALL                                         $39     
         63        ASSIGN                                                   !2, $39
   45    64        ASSIGN                                                   !3, 0
         65      > JMP                                                      ->71
   47    66    >   INIT_FCALL                                               'array_shift'
         67        SEND_REF                                                 !5
         68        DO_ICALL                                         $42     
         69        ASSIGN                                                   !6, $42
   45    70        PRE_INC                                                  !3
         71    >   IS_SMALLER                                               !3, 20000
         72      > JMPNZ                                                    ~45, ->66
   50    73    >   INIT_FCALL                                               'microtime'
         74        SEND_VAL                                                 <true>
         75        DO_ICALL                                         $46     
         76        ASSIGN                                                   !4, $46
   51    77        SUB                                              ~48     !4, !2
         78        ECHO                                                     ~48
         79        ECHO                                                     'push%3Cbr%2F%3E'
   54    80      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.53 ms | 1404 KiB | 17 Q