3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['foo'=>1, 'bar'=> 2]; var_dump(memory_get_usage()); foreach($array as $k=>&$v) { var_dump(memory_get_usage()); $array['baz']=3; var_dump(memory_get_usage()); echo $v . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 24
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/1G7Ck
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'memory_get_usage'
          3        DO_ICALL                                         $4      
          4        SEND_VAR                                                 $4
          5        DO_ICALL                                                 
    6     6      > FE_RESET_RW                                      $6      !0, ->24
          7    > > FE_FETCH_RW                                      ~7      $6, !1, ->24
          8    >   ASSIGN                                                   !2, ~7
    8     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'memory_get_usage'
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
    9    14        ASSIGN_DIM                                               !0, 'baz'
         15        OP_DATA                                                  3
   10    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'memory_get_usage'
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
         20        DO_ICALL                                                 
   11    21        CONCAT                                           ~14     !1, '%0A'
         22        ECHO                                                     ~14
    6    23      > JMP                                                      ->7
         24    >   FE_FREE                                                  $6
   12    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.37 ms | 1387 KiB | 17 Q