I have a master class with several separate classes that I want to link up together so I can share variables defined in the master class. The problem is only the first slave class can read the $x variable, every subsequent slave class (I have 20 others) shows $x as blank. For example:
class Master {
var $x;
function initialize{) {
$this->x = 'y';
}
}
class Slave1 extends Master {
function process(){
echo $this->x;
}
}
class Slave2 extends Master {
function process(){
echo $this->x;
}
}
Am I doing something wrong here? I've never used extended classes before so I've no idea what I'm doing :)
->initialize()on every single instance?