3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach(get_defined_vars()as $key => $v) { unset($GLOBALS[$key]); } unset($key, $v); $a=5; $b = 6; $count = count(get_defined_vars()); $new = 8; $vars=array_slice(get_defined_vars(), $count); var_dump($vars);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Bd3oM
function name:  (null)
number of ops:  29
compiled vars:  !0 = $v, !1 = $key, !2 = $a, !3 = $b, !4 = $count, !5 = $new, !6 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'get_defined_vars'
          1        DO_ICALL                                         $7      
          2      > FE_RESET_R                                       $8      $7, ->8
          3    > > FE_FETCH_R                                       ~9      $8, !0, ->8
          4    >   ASSIGN                                                   !1, ~9
    6     5        FETCH_UNSET                                      $11     'GLOBALS'
          6        UNSET_DIM                                                $11, !1
    4     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $8
    8     9        UNSET_CV                                                 !1
         10        UNSET_CV                                                 !0
   11    11        ASSIGN                                                   !2, 5
   12    12        ASSIGN                                                   !3, 6
   14    13        INIT_FCALL                                               'get_defined_vars'
         14        DO_ICALL                                         $14     
         15        COUNT                                            ~15     $14
         16        ASSIGN                                                   !4, ~15
   16    17        ASSIGN                                                   !5, 8
   18    18        INIT_FCALL                                               'array_slice'
         19        INIT_FCALL                                               'get_defined_vars'
         20        DO_ICALL                                         $18     
         21        SEND_VAR                                                 $18
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $19     
         24        ASSIGN                                                   !6, $19
   19    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !6
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.22 ms | 1396 KiB | 19 Q