Forum Moderators: coopster

Message Too Old, No Replies

How to see all used Variables?

Is it possible to print somehow all used variables

         

AcsCh

2:00 pm on Nov 5, 2005 (gmt 0)

10+ Year Member



After years of lonesome coding the project grows and there are now a few more coding with me. Is there some way to print out all variables used in my "faboulous" :/ scripts to make things easier for my predecesors, that I can document them without forgetting most of them?
Evidently variables are not nicely in an Array.. would be too easy.. :(

sort of:
$ThisVariable
$ThisImportantValue
$AnotherValue
$TheUltimativeVariable
....

jatar_k

4:41 pm on Nov 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



kind of hard to do

you could look at something like phpdoc (though that might require a bunch of comment changes, can't remember) or even just look at a good editor that will list them in a window.

In a similar scenarion when I was added as a programmer to an existing project we just muddled our way through and commented as we went.

directrix

5:14 pm on Nov 5, 2005 (gmt 0)

10+ Year Member



Check out get_defined_vars() -- it may give you much of what you need, bearing in mind scope considerations.

Also useful in debugging: var_dump(get_defined_vars())

AcsCh

6:10 pm on Nov 5, 2005 (gmt 0)

10+ Year Member



highly appreciated directrix!

(but it's hard to see the horror of hundreds of variables, I do not even remember, from a few years coding laid out in front of you. ;)

NomikOS

7:41 pm on Nov 5, 2005 (gmt 0)

10+ Year Member



sad ;(
is very difficult your situation.
only my best wishes

Is a real challenge to do something about it.
something much more easy to use than phpDoc.