3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); $a[1] = 'toto'; $m = memory_get_usage(); $a[2] = 'titi'; $m2 = memory_get_usage(); $a[1000000] = 'tata'; echo $m2-$m . ' '. memory_get_usage() - $m;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/149LU
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $m, !2 = $m2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 1
          2        OP_DATA                                                  'toto'
    4     3        INIT_FCALL                                               'memory_get_usage'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    5     6        ASSIGN_DIM                                               !0, 2
          7        OP_DATA                                                  'titi'
    6     8        INIT_FCALL                                               'memory_get_usage'
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    7    11        ASSIGN_DIM                                               !0, 1000000
         12        OP_DATA                                                  'tata'
    8    13        SUB                                              ~11     !2, !1
         14        CONCAT                                           ~12     ~11, '+'
         15        INIT_FCALL                                               'memory_get_usage'
         16        DO_ICALL                                         $13     
         17        SUB                                              ~14     $13, !1
         18        CONCAT                                           ~15     ~12, ~14
         19        ECHO                                                     ~15
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.25 ms | 1399 KiB | 15 Q