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 = array_map(function($v){ return $v; }, $a1); // capacity is trimmed down. how many resizes are performed? unset($a1); var_dump(memory_get_usage()); $a2[] = true; 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/deeLZ
function name:  (null)
number of ops:  37
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        INIT_FCALL                                               'array_map'
         18        DECLARE_LAMBDA_FUNCTION                          ~11     [0]
         19        SEND_VAL                                                 ~11
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !3, $12
    9    23        UNSET_CV                                                 !0
   10    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'memory_get_usage'
         26        DO_ICALL                                         $14     
         27        SEND_VAR                                                 $14
         28        DO_ICALL                                                 
   13    29        ASSIGN_DIM                                               !3
         30        OP_DATA                                                  <true>
   14    31        INIT_FCALL                                               'var_dump'
         32        INIT_FCALL                                               'memory_get_usage'
         33        DO_ICALL                                         $17     
         34        SEND_VAR                                                 $17
         35        DO_ICALL                                                 
         36      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deeLZ
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.54 ms | 1075 KiB | 17 Q