// SCOPE 1
printsmth();
function printsmth(){
// SCOPE 2 (printsmth)
// here (inside SCOPE 2) get variables visible in SCOPE 1
// var_dump($vars);
}
Can I do this?
Essentially I want to get all declared variables from where my function was called, but inside the function (and ignore variables declared in my function)
something like getting the result of get_defined_vars();
, within my function, but for the previous scope :)