PHP - Classes and Objects
Consider this PHP code:
What will be the output and why?
class ParentClass {
protected $value = 10;
}
class ChildClass extends ParentClass {
public function getValue() {
return $this->value;
}
}
$child = new ChildClass();
echo $child->getValue();What will be the output and why?
