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>'; 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/5eNBa
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '%3Cpre%3E'
   10     1        FETCH_R                      global              ~0      'GLOBALS'
          2        GET_TYPE                                         ~1      ~0
          3        ECHO                                                     ~1
   11     4        INIT_FCALL                                               'f'
          5        FETCH_R                      global              ~2      'GLOBALS'
          6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0          
   12     8        FETCH_R                      global              ~4      'GLOBALS'
          9        GET_TYPE                                         ~5      ~4
         10        ECHO                                                     ~5
         11      > 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/5eNBa
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:
159.66 ms | 1398 KiB | 14 Q