I have the following 3 classes :
class ParentClass {
protected $myVar = array();
function __construct() {
var_dump($this->myVar);
}
}
class FirstClass extends ParentClass {
protected $myVar = array('defaultVal');
}
class SecondClass extends FirstClass {
protected $myVar = array('anotherVal');
}
If I was to do the following:
$class = new SecondClass();
Then I would get array('anotherVal') what can I add to the construct of ParentClass so that I would actually get array('defaultVal', 'anotherVal')
Thanks in advance!
function __construct() { $this->myVar = array('defaultVal', 'anotherVal'); }Otherwise, you need to be more specific about what you're trying to accomplish (and possibly why).