How can a protected variable be accessed from a child Class if it has a different value?
Example to wrong access: parent::$_my gives error
class Father{
protected $_my=array('a','b');
}
class Child{
protected $_my=array('c','d');
function __construct(){
parent::__construct();
$this->_my=array_merge(parent::$_my,$this->_my);
}
}
Thanks, Yosef
extendskeyword - likeClass Child extends Father$_myinChildwill overwrite the values set inFather