3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testVar = 'foo'; // 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/ehccq
function name:  (null)
number of ops:  20
compiled vars:  !0 = $testVar, !1 = $ignore, !2 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'foo'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_diff_key'
          3        INIT_FCALL                                               'get_defined_vars'
          4        DO_ICALL                                         $5      
          5        INIT_FCALL                                               'array_flip'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        ADD                                              ~7      $5, $6
          9        SEND_VAL                                                 ~7
         10        INIT_FCALL                                               'array_flip'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
    8    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.85 ms | 1395 KiB | 21 Q