3v4l.org

run code in 500+ PHP versions simultaneously
<?php function f($var){ foreach($var as $k => $v){ unset($var[$k]); } } print gettype($GLOBALS); f($GLOBALS); print gettype($GLOBALS);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OuOM0
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_GLOBALS                                        ~0      
          1        GET_TYPE                                             ~1      ~0
          2        ECHO                                                         ~1
   10     3        INIT_FCALL                                                   'f'
          4        FETCH_GLOBALS                                        ~2      
          5        SEND_VAL                                                     ~2
          6        DO_FCALL                                          0          
   11     7        FETCH_GLOBALS                                        ~4      
          8        GET_TYPE                                             ~5      ~4
          9        ECHO                                                         ~5
         10      > 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/OuOM0
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.5.0


preferences:
229.91 ms | 3286 KiB | 14 Q