3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testVar = 'foo'; $var2 = 'two'; // list of keys to ignore (including the name of this variable) $ignore = array('GLOBALS', '_FILES', '_COOKIE', '_POST', '_GET', '_SERVER', '_ENV', 'ignore'); // diff the ignore list as keys after merging any missing ones with the defined list $vars = array_diff_key(get_defined_vars() + array_flip($ignore), array_flip($ignore)); // should be left with the user defined var(s) (in this case $testVar) var_dump($vars);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gf8PM
function name:  (null)
number of ops:  21
compiled vars:  !0 = $testVar, !1 = $var2, !2 = $ignore, !3 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'foo'
    3     1        ASSIGN                                                   !1, 'two'
    5     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'array_diff_key'
          4        INIT_FCALL                                               'get_defined_vars'
          5        DO_ICALL                                         $7      
          6        INIT_FCALL                                               'array_flip'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $8      
          9        ADD                                              ~9      $7, $8
         10        SEND_VAL                                                 ~9
         11        INIT_FCALL                                               'array_flip'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !3, $11
    9    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.46 ms | 1395 KiB | 21 Q