This question already has an answer here:
<?php
class a
{
protected $c=10;
}
class b extends a{
echo a::$c;
}
//$obj = new b();
?>
Here I am trying to print the parent class variable in the child class. can you tell me how to make use of the parent class variables in child class in PHP5?
</div>
class parent {
protected $field;
}
class child extends parent {
public function test() {
return $this->field;
}
}