Re: [PHP-WIN] Static array causing problem in recursion

2009-12-04 Thread Richard Quadling
2009/12/4 Midhun Girish : > hello all, > > hey Richard Quadling you are right... sorry man.. i just noticed that just > now. > > Actually i missed th line self::getAllChildren($child,$levelcount,False); > that you gave and thought it was a mistake...that y i updated the > script...you can imagine t

Re: [PHP-WIN] Static array causing problem in recursion

2009-12-04 Thread Midhun Girish
hello all, hey Richard Quadling you are right... sorry man.. i just noticed that just now. Actually i missed th line self::getAllChildren($child,$levelcount,False); that you gave and thought it was a mistake...that y i updated the script...you can imagine the condition of a person who searched ov

Re: [PHP-WIN] Static array causing problem in recursion

2009-12-04 Thread Richard Quadling
2009/12/4 Midhun Girish : > Hello , > > Richard Quadling thank you so much.. your trick worked... :) now its > working.. heres the modified code... > >  public function getAllChildren($node,$level,$firstCall=false) >> >>   { >>       static $rootsarray=array(); >>       static $levelcount; >>      

Re: [PHP-WIN] Static array causing problem in recursion

2009-12-04 Thread Midhun Girish
Hello , Richard Quadling thank you so much.. your trick worked... :) now its working.. heres the modified code... public function getAllChildren($node,$level,$firstCall=false) > > { > static $rootsarray=array(); > static $levelcount; >if($firstCall) { > $rootsarr

Re: [PHP-WIN] Static array causing problem in recursion

2009-12-04 Thread Richard Quadling
2009/12/4 Midhun Girish > > Hello guys, > I was trying to use a recursive function to do a tree traversal.. i used a > static array to store the nodes at each recursion.. The function works > correctly if it is called only once during an execution.. but when i call it > twice or more, the nodes ge