Re: Re: variable container?
| From: | memoimyself at yahoo dot com dot br | Date: | Mon, 26 Jan 2004 23:12:20 +0000 |
| Subject: | Re: Re: variable container? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175827@lists.php.net to get a copy of this message | ||
Hello Jake,
On 26 Jan 2004 at 17:55, Jake McHenry wrote:
> I want a list of all variables used. I tried just putting var_dump() but got
> an error. I'd like to see a list of all variables being used in the script,
> then I can start cleaning original code and what I have added. Some strange
> results lead me to believe I'm declaring the variables more than once with
> different values, and I'd like to know if there is a way that I can just get
> a dump of ALL the variables in use. Unless I'm using the function wrong.
> Please advise.
I don't think you can print out *all* the variables in *all* scopes and their values, but you
can certainly get a list of all the variables in the global scope (i.e. all variables except the
ones created inside functions and classes). print_r ($GLOBALS) will give you all the
super-global arrays ($_POST, $_GET, $_SERVER etc) as well as all user variables
created in the global scope. Look for *RECURSION* in the output; that's where you'll
find the user variables.
Hope this helps,
Erik