PHP - Classes and Objects
What will be the output of the following PHP code?
class Score {
private $points = 0;
public function addPoint() {
$this->points++;
}
public function getPoints() {
return $this->points;
}
}
$score = new Score();
$score->addPoint();
$score->addPoint();
$score->addPoint();
echo $score->getPoints();