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