PHP - Classes and Objects
Identify the error in this PHP code:
class ParentClass {
protected $value = 10;
}
class ChildClass extends ParentClass {
public function getValue() {
return $this->value;
}
}
$obj = new ParentClass();
echo $obj->value;