Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
January 3, 2015, 3:43 pm
rate this thread
dump($GLOBALS) before, go figure. So, var_dump($GLOBALS['GLOBALS'])
works fine, and shows ["GLOBALS"]=> *RECURSION* so clearly it can
identify $GLOBALS['GLOBALS'] either as a special-case or through some
other mechanism. I can certainly deal with it as a special-case until I
have time to figure it out, but is there some cleaner way to identify a
variable that is itself recursive?
Re: how to identify $GLOBALS['GLOBAL'] as recursive?
The way that I have seen some routines use is to add as a "special"
member/subscripts (with a "unique" label, something like
globalcheck_aerakwefnsdfnalvsuefc) a flag, and as you walk through the
object, you check each sub-object for that flag before processing. Then,
after you are done, you can walk the same way removing to flag (and not
going into objects that don't have the flag set).
- » Running same code multiple times, while only changing two parameters
- — Next thread in » PHP Scripting Forum