Re: Re: variable container?
| From: | Shawn McKenzie | Date: | Tue, 27 Jan 2004 05:14:07 +0000 |
| Subject: | Re: Re: variable container? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175849@lists.php.net to get a copy of this message | ||
So why not use: get_defined_vars()?
Returns an array of all defined variables :-)
-Shawn
"Jake McHenry" <linux@nittanytravel.com> wrote in message
news:001d01c3e463$439e5110$7fa1e518@JS...
> ----- Original Message -----
> From: <memoimyself@yahoo.com.br>
> To: <php-general@lists.php.net>
> Sent: Monday, January 26, 2004 6:12 PM
> Subject: Re: [PHP] Re: variable container?
>
>
> > 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
> >
>
> I think this may be it. I'll try it and let everyone know.
>
> Thanks!
>
> Jake