3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $arr = []; for ($i = 0; $i < 1000; $i++) { array_push($arr, $i); } $end = microtime(true); echo number_format($end - $start, 8, '.', '') . "\n"; unset($arr); $start = microtime(true); $arr = []; for ($i = 0; $i < 1000; $i++) { $arr[] = $i; } $end = microtime(true); echo number_format($end - $start, 8, '.', '') . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
Branch analysis from position: 35
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/tk351
function name:  (null)
number of ops:  54
compiled vars:  !0 = $start, !1 = $arr, !2 = $i, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        ASSIGN                                                   !1, <array>
    5     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->12
    6     7    >   INIT_FCALL                                               'array_push'
          8        SEND_REF                                                 !1
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
    5    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 1000
         13      > JMPNZ                                                    ~10, ->7
    9    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   10    18        INIT_FCALL                                               'number_format'
         19        SUB                                              ~13     !3, !0
         20        SEND_VAL                                                 ~13
         21        SEND_VAL                                                 8
         22        SEND_VAL                                                 '.'
         23        SEND_VAL                                                 ''
         24        DO_ICALL                                         $14     
         25        CONCAT                                           ~15     $14, '%0A'
         26        ECHO                                                     ~15
   12    27        UNSET_CV                                                 !1
   14    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $16     
         31        ASSIGN                                                   !0, $16
   15    32        ASSIGN                                                   !1, <array>
   16    33        ASSIGN                                                   !2, 0
         34      > JMP                                                      ->38
   17    35    >   ASSIGN_DIM                                               !1
         36        OP_DATA                                                  !2
   16    37        PRE_INC                                                  !2
         38    >   IS_SMALLER                                               !2, 1000
         39      > JMPNZ                                                    ~22, ->35
   20    40    >   INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $23     
         43        ASSIGN                                                   !3, $23
   21    44        INIT_FCALL                                               'number_format'
         45        SUB                                              ~25     !3, !0
         46        SEND_VAL                                                 ~25
         47        SEND_VAL                                                 8
         48        SEND_VAL                                                 '.'
         49        SEND_VAL                                                 ''
         50        DO_ICALL                                         $26     
         51        CONCAT                                           ~27     $26, '%0A'
         52        ECHO                                                     ~27
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.7 ms | 1400 KiB | 19 Q