3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all = []; for( $i=0; $i<7000; $i++ ) { for( $j=0; $j<500; $j++ ) { $all[$i][$j] = $j; } } $start = microtime(true); $mergedArray = array_merge(...$all); echo PHP_EOL . 'Array merge time: ' . microtime(true); $mergedArray = []; $start = microtime(true); foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } echo PHP_EOL . 'Union time: ' . microtime(true);
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 = 3
Branch analysis from position: 14
2 jumps found. (Code = 125) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
2 jumps found. (Code = 126) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 3
Branch analysis from position: 14
Branch analysis from position: 3
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/hi8hc
function name:  (null)
number of ops:  44
compiled vars:  !0 = $all, !1 = $i, !2 = $j, !3 = $start, !4 = $mergedArray, !5 = $templateClosingArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->12
    5     3    >   ASSIGN                                                   !2, 0
          4      > JMP                                                      ->9
    6     5    >   FETCH_DIM_W                                      $9      !0, !1
          6        ASSIGN_DIM                                               $9, !2
          7        OP_DATA                                                  !2
    5     8        PRE_INC                                                  !2
          9    >   IS_SMALLER                                               !2, 500
         10      > JMPNZ                                                    ~12, ->5
    4    11    >   PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 7000
         13      > JMPNZ                                                    ~14, ->3
   11    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !3, $15
   12    18        INIT_FCALL                                               'array_merge'
         19        SEND_UNPACK                                              !0
         20        CHECK_UNDEF_ARGS                                         
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !4, $17
   13    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $19     
         26        CONCAT                                           ~20     '%0AArray+merge+time%3A+', $19
         27        ECHO                                                     ~20
   14    28        ASSIGN                                                   !4, <array>
   15    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $22     
         32        ASSIGN                                                   !3, $22
   16    33      > FE_RESET_RW                                      $24     !0, ->37
         34    > > FE_FETCH_RW                                              $24, !5, ->37
   17    35    >   ASSIGN_OP                                     1          !4, !5
   16    36      > JMP                                                      ->34
         37    >   FE_FREE                                                  $24
   19    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $26     
         41        CONCAT                                           ~27     '%0AUnion+++++++time%3A+', $26
         42        ECHO                                                     ~27
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.22 ms | 1008 KiB | 15 Q