Re: [PHP-WIN]static call to an instance method in a class definition

2010-07-22 Thread Ferenc Kovacs
Hi. I knew about this "feature" ($this is used from the caller scope if the called method is static), but I didn't checked the manual about this. Now I did it. http://php.net/manual/en/language.oop5.static.php "Because static methods are callable without an instance of the object created, the pse

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

Re: [PHP-WIN] static

2005-03-02 Thread Jason Barnett
> > class foo { > > static public $a = 1; > > public function __construct() { > > echo $this->a; /* does not work */ > > echo foo::$a; /* work */ echo self::$a; /* work */ > > } > > } > > > > Can someone please explain to me why I have to call $a outside the class to > get the v

RE: [PHP-WIN] static

2005-03-02 Thread N . A . Morgan
Check out the Zend website http://www.zend.com/manual/language.oop5.static.php Neil Morgan -Original Message- From: Joakim Ling [mailto:[EMAIL PROTECTED] Sent: 02 March 2005 08:53 To: php-windows@lists.php.net Subject: [PHP-WIN] static hi class foo { static public $a = 1; public