PHP - Classes and Objects
Given the class below, what will be the output?
class Counter {
private $count = 0;
public function increment() {
$this->count++;
}
public function getCount() {
return $this->count;
}
}
$c = new Counter();
$c->increment();
$c->increment();
echo $c->getCount();