3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; $startMemory = memory_get_usage(); foreach (range(1, 100000) as $i) { $array[] = "adfsdfghsfghfsgh $i"; } echo "seq array: ", memory_get_usage() - $startMemory, " bytes\n"; foreach (range(1, 100000) as $i) { $array["test$i"] = "sdfghsfghsfg $i"; } echo "seq+assoc array: ", memory_get_usage() - $startMemory, " bytes\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 35
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 35
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 15
filename:       /in/PKaSN
function name:  (null)
number of ops:  43
compiled vars:  !0 = $array, !1 = $startMemory, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !1, $4
    6     4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 100000
          7        DO_ICALL                                         $6      
          8      > FE_RESET_R                                       $7      $6, ->15
          9    > > FE_FETCH_R                                               $7, !2, ->15
    7    10    >   NOP                                                      
         11        FAST_CONCAT                                      ~9      'adfsdfghsfghfsgh+', !2
         12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  ~9
    6    14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $7
    9    16        ECHO                                                     'seq+array%3A+'
         17        INIT_FCALL                                               'memory_get_usage'
         18        DO_ICALL                                         $10     
         19        SUB                                              ~11     $10, !1
         20        ECHO                                                     ~11
         21        ECHO                                                     '+bytes%0A'
   11    22        INIT_FCALL                                               'range'
         23        SEND_VAL                                                 1
         24        SEND_VAL                                                 100000
         25        DO_ICALL                                         $12     
         26      > FE_RESET_R                                       $13     $12, ->35
         27    > > FE_FETCH_R                                               $13, !2, ->35
   12    28    >   NOP                                                      
         29        FAST_CONCAT                                      ~14     'test', !2
         30        NOP                                                      
         31        FAST_CONCAT                                      ~16     'sdfghsfghsfg+', !2
         32        ASSIGN_DIM                                               !0, ~14
         33        OP_DATA                                                  ~16
   11    34      > JMP                                                      ->27
         35    >   FE_FREE                                                  $13
   14    36        ECHO                                                     'seq%2Bassoc+array%3A+'
         37        INIT_FCALL                                               'memory_get_usage'
         38        DO_ICALL                                         $17     
         39        SUB                                              ~18     $17, !1
         40        ECHO                                                     ~18
         41        ECHO                                                     '+bytes%0A'
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.94 ms | 1400 KiB | 17 Q