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
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
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
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;
>>
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
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
>
> 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
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