PHP - Classes and Objects
Consider the following PHP code:
What will be the output?
class ParentClass {
protected $name = 'Parent';
}
class ChildClass extends ParentClass {
public function getName() {
return $this->name;
}
}
$child = new ChildClass();
echo $child->getName();What will be the output?
