hello,
I have 2 classes:
class a{
var $x=1;
}
class b extends a{
var $x=2;
function display(){
echo $this->x," ",$this::name;
}
}
The documentation writes, that you can refer to the variables in the base class with the operator '::'. If I wrote:
$q=new b;
$q->display();
I received:
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';'
I changed the code of the display() function, trying:
echo $this->x," ",a::name;
or:
echo $this->x," ",a::$name;
but it didn't work.
Can anyone tell me how to refer to a variable from the base class? I'm interested about variables which are redefined in the child class, because the other variables are inherited anyway.