3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit',-1); $i=10000; $a=[]; $time_a=microtime(true); for($z=0;$z<$i;$z++){ $a=array_merge($a,[0,1,2,3,4,5,6,7,8,9]); } $time_a=microtime(true)-$time_a; $b=[]; $time_b=microtime(true); for($z=0;$z<$i;$z++){ $b=[...$b,...[0,1,2,3,4,5,6,7,8,9]]; } $time_b=microtime(true)-$time_b; $c=[]; $time_c=microtime(true); for($z=0;$z<$i;$z++){ array_push($c,...[0,1,2,3,4,5,6,7,8,9]); // $b[]=...[0,1,2,3,4,5,6,7,8,9]; } $time_c=microtime(true)-$time_c; print($time_a.' sec'); print('<br/>'); print($time_b.' sec'); print('<br/>'); print($time_c.' sec');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 12
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 32
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 51
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 51
Branch analysis from position: 59
Branch analysis from position: 51
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 32
Branch analysis from position: 39
Branch analysis from position: 32
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 12
Branch analysis from position: 20
Branch analysis from position: 12
filename:       /in/DHUsU
function name:  (null)
number of ops:  73
compiled vars:  !0 = $i, !1 = $a, !2 = $time_a, !3 = $z, !4 = $b, !5 = $time_b, !6 = $c, !7 = $time_c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'memory_limit'
          2        SEND_VAL                                                 -1
          3        DO_ICALL                                                 
    5     4        ASSIGN                                                   !0, 10000
    7     5        ASSIGN                                                   !1, <array>
    8     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !2, $11
    9    10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->18
   10    12    >   INIT_FCALL                                               'array_merge'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 <array>
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !1, $14
    9    17        PRE_INC                                                  !3
         18    >   IS_SMALLER                                               !3, !0
         19      > JMPNZ                                                    ~17, ->12
   12    20    >   INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $18     
         23        SUB                                              ~19     $18, !2
         24        ASSIGN                                                   !2, ~19
   14    25        ASSIGN                                                   !4, <array>
   15    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $22     
         29        ASSIGN                                                   !5, $22
   16    30        ASSIGN                                                   !3, 0
         31      > JMP                                                      ->37
   17    32    >   INIT_ARRAY                                       ~25     
         33        ADD_ARRAY_UNPACK                                 ~25     !4
         34        ADD_ARRAY_UNPACK                                 ~25     <array>
         35        ASSIGN                                                   !4, ~25
   16    36        PRE_INC                                                  !3
         37    >   IS_SMALLER                                               !3, !0
         38      > JMPNZ                                                    ~28, ->32
   19    39    >   INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $29     
         42        SUB                                              ~30     $29, !5
         43        ASSIGN                                                   !5, ~30
   21    44        ASSIGN                                                   !6, <array>
   22    45        INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $33     
         48        ASSIGN                                                   !7, $33
   23    49        ASSIGN                                                   !3, 0
         50      > JMP                                                      ->57
   24    51    >   INIT_FCALL                                               'array_push'
         52        SEND_REF                                                 !6
         53        SEND_UNPACK                                              <array>
         54        CHECK_UNDEF_ARGS                                         
         55        DO_ICALL                                                 
   23    56        PRE_INC                                                  !3
         57    >   IS_SMALLER                                               !3, !0
         58      > JMPNZ                                                    ~38, ->51
   26    59    >   INIT_FCALL                                               'microtime'
         60        SEND_VAL                                                 <true>
         61        DO_ICALL                                         $39     
         62        SUB                                              ~40     $39, !7
         63        ASSIGN                                                   !7, ~40
   28    64        CONCAT                                           ~42     !2, '+sec'
         65        ECHO                                                     ~42
   29    66        ECHO                                                     '%3Cbr%2F%3E'
   30    67        CONCAT                                           ~43     !5, '+sec'
         68        ECHO                                                     ~43
   31    69        ECHO                                                     '%3Cbr%2F%3E'
   32    70        CONCAT                                           ~44     !7, '+sec'
         71        ECHO                                                     ~44
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.85 ms | 1400 KiB | 21 Q