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!
After furthur research i found out an easy way to do it get_class_vars:
This solves my problems…
Thanks anyway guys!