3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.18 ms | 1400 KiB | 17 Q