is there any way to get list of variables that were defined in function, or list of all accessible variables in a function?
+2
A:
There is get_defined_vars()
:
This function returns a multidimensional array containing a list of all defined variables, be them environment, server or user-defined variables, within the scope that get_defined_vars() is called.
it has to be called within each function you want to analyze, though.
Pekka
2010-10-22 10:03:01
thanks, im an idiot, just read the manual for that function before posting question, but couldnt test it normally because of mistake in code
samrockon
2010-10-22 10:16:26
A:
func_num_args — Returns the number of arguments passed to the function func_get_arg — Return an item from the argument list func_get_args — Returns an array comprising a function's argument list
Jim
2010-10-22 10:04:15
thanks, but i needed vars defined in the function, not that are passed to func
samrockon
2010-10-22 10:17:24
+1
A:
http://php.net/manual/en/function.get-defined-vars.php
Documentation indeed ^^
MatTheCat
2010-10-22 10:05:16