static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi

 

class foo {

 static public $a = 1;

 public function __construct() {

  echo $this->a; /* does not work */

  echo foo::$a; /* work */

 }

}

 

Can someone please explain to me why I have to call $a outside the class
to get the value?


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux