3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = memory_get_usage(); $names = array_fill(0, 1000, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); echo "10k values in a 1000x10 matrix: ", round((memory_get_usage()-$start)/1024),"KB\n"; $names = array_merge(...$names); echo "Same 10k values in a plain vector: ", round((memory_get_usage()-$start)/1024),"KB\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2HItq
function name:  (null)
number of ops:  35
compiled vars:  !0 = $start, !1 = $names
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
    5     3        INIT_FCALL                                               'array_fill'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1000
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    6     9        ECHO                                                     '10k+values+in+a+1000x10+matrix%3A+++++'
         10        INIT_FCALL                                               'round'
         11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $6      
         13        SUB                                              ~7      $6, !0
         14        DIV                                              ~8      ~7, 1024
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        ECHO                                                     $9
         18        ECHO                                                     'KB%0A'
    8    19        INIT_FCALL                                               'array_merge'
         20        SEND_UNPACK                                              !1
         21        CHECK_UNDEF_ARGS                                         
         22        DO_ICALL                                         $10     
         23        ASSIGN                                                   !1, $10
    9    24        ECHO                                                     'Same+10k+values+in+a+plain+vector%3A+'
         25        INIT_FCALL                                               'round'
         26        INIT_FCALL                                               'memory_get_usage'
         27        DO_ICALL                                         $12     
         28        SUB                                              ~13     $12, !0
         29        DIV                                              ~14     ~13, 1024
         30        SEND_VAL                                                 ~14
         31        DO_ICALL                                         $15     
         32        ECHO                                                     $15
         33        ECHO                                                     'KB%0A'
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.14 ms | 1436 KiB | 17 Q