class Class1{
protected $year = 1;
public function setYear($year){
$this->year = $year;
}
}
class Class2 extends Class1{
public function getYear(){
return $this->year;
}
}
$class1 = new Class1();
$class1->setYear(2018);
$class2 = new Class2();
echo $class2->getYear(); //NULL