PHP Manual entry for get_defined_vars():
"This function returns an multidimensional array containing a list of all defined variables, be them environment, server or user-defined variables"
It doesn't say anything about scope. Where might I have found that aspect documented? Or did you just figure that out yourself via trial&error?
The reason I refer to GLOBALS is that, as far as I can see, it has the same value as get_defined_vars() (when get_defined_vars() is called outside a function, that is).
But thanks for the confirmation, colinhorne!
BTW, array_keys(array_slice($GLOBALS,13)) seems to return the names of user-defined variables. Don't know whether that's always (using 13 as an index) the case...
But I like it...