3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($var){ // not using references foreach($var as $k => $v){ unset($var[$k]); // shouldn't this unset from a copy?! } } print '<pre>'; var_dump($GLOBALS); // array f($GLOBALS); var_dump($GLOBALS); // null?!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/khGDA
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '%3Cpre%3E'
   10     1        INIT_FCALL                                               'var_dump'
          2        FETCH_R                      global              ~0      'GLOBALS'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   11     5        INIT_FCALL                                               'f'
          6        FETCH_R                      global              ~2      'GLOBALS'
          7        SEND_VAL                                                 ~2
          8        DO_FCALL                                      0          
   12     9        INIT_FCALL                                               'var_dump'
         10        FETCH_R                      global              ~4      'GLOBALS'
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/khGDA
function name:  f
number of ops:  8
compiled vars:  !0 = $var, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > FE_RESET_R                                       $3      !0, ->6
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->6
          3    >   ASSIGN                                                   !2, ~4
    5     4        UNSET_DIM                                                !0, !2
    4     5      > JMP                                                      ->2
          6    >   FE_FREE                                                  $3
    7     7      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.08 ms | 1398 KiB | 16 Q