how to identify $GLOBALS['GLOBAL'] as recursive?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've had a dump() subroutine for years but never happened to  
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?

On 1/3/15 10:43 AM, crankypuss wrote:
Quoted text here. Click to load it

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).

Site Timeline