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()); echo $count; $vars=array_slice($b, 1); 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/TC88q
function name:  (null)
number of ops:  27
compiled vars:  !0 = $v, !1 = $key, !2 = $a, !3 = $b, !4 = $count, !5 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'get_defined_vars'
          1        DO_ICALL                                         $6      
          2      > FE_RESET_R                                       $7      $6, ->8
          3    > > FE_FETCH_R                                       ~8      $7, !0, ->8
          4    >   ASSIGN                                                   !1, ~8
    6     5        FETCH_UNSET                                      $10     'GLOBALS'
          6        UNSET_DIM                                                $10, !1
    4     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $7
    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                                         $13     
         15        COUNT                                            ~14     $13
         16        ASSIGN                                                   !4, ~14
   15    17        ECHO                                                     !4
   17    18        INIT_FCALL                                               'array_slice'
         19        SEND_VAR                                                 !3
         20        SEND_VAL                                                 1
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !5, $16
   18    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !5
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.01 ms | 1395 KiB | 19 Q