3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = array_fill(0, 100000, true); foreach($a1 as $k => $v){ unset($a1[$k]); } var_dump(memory_get_usage()); $a2 = $a1; // capacity will be same as original despite $a1 is empty $a2[] = true; var_dump(memory_get_usage()); unset($a1); var_dump(memory_get_usage());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/iGWlX
function name:  (null)
number of ops:  32
compiled vars:  !0 = $a1, !1 = $v, !2 = $k, !3 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_fill'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 100000
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    4     6      > FE_RESET_R                                       $6      !0, ->11
          7    > > FE_FETCH_R                                       ~7      $6, !1, ->11
          8    >   ASSIGN                                                   !2, ~7
          9        UNSET_DIM                                                !0, !2
         10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $6
    5    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'memory_get_usage'
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                                 
    8    17        ASSIGN                                                   !3, !0
   10    18        ASSIGN_DIM                                               !3
         19        OP_DATA                                                  <true>
   11    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'memory_get_usage'
         22        DO_ICALL                                         $13     
         23        SEND_VAR                                                 $13
         24        DO_ICALL                                                 
   13    25        UNSET_CV                                                 !0
   14    26        INIT_FCALL                                               'var_dump'
         27        INIT_FCALL                                               'memory_get_usage'
         28        DO_ICALL                                         $15     
         29        SEND_VAR                                                 $15
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.22 ms | 1001 KiB | 16 Q