3v4l.org

run code in 500+ PHP versions simultaneously
<?php function all_local_vars(){ $initial_vars = array_keys(get_defined_vars()); $foo = 0; $bar = 'hoge'; return compact(array_diff(array_keys(get_defined_vars()), $initial_vars)); } var_dump(all_local_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XZPnO
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'all_local_vars'
          2        DO_FCALL                                          0  $0      
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
          5      > RETURN                                                       1

Function all_local_vars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XZPnO
function name:  all_local_vars
number of ops:  22
compiled vars:  !0 = $initial_vars, !1 = $foo, !2 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                                   'array_keys'
          1        INIT_FCALL                                                   'get_defined_vars'
          2        DO_ICALL                                             $3      
          3        SEND_VAR                                                     $3
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !0, $4
    5     6        ASSIGN                                                       !1, 0
    6     7        ASSIGN                                                       !2, 'hoge'
    7     8        INIT_FCALL                                                   'compact'
          9        INIT_FCALL                                                   'array_diff'
         10        INIT_FCALL                                                   'array_keys'
         11        INIT_FCALL                                                   'get_defined_vars'
         12        DO_ICALL                                             $8      
         13        SEND_VAR                                                     $8
         14        DO_ICALL                                             $9      
         15        SEND_VAR                                                     $9
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                             $10     
         18        SEND_VAR                                                     $10
         19        DO_ICALL                                             $11     
         20      > RETURN                                                       $11
    8    21*     > RETURN                                                       null

End of function all_local_vars

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
142.05 ms | 2086 KiB | 19 Q