Challenge 2 — Solution Task: Create a Counter class with a private property $count starting at 0, and public methods increment() (adds 1), decrement() (subtracts 1), and getCount(). Create one Counter, call increment() three times and decrement() once, then echo the result via getCount(). count += 1; } public function decrement() { $this->count -= 1; } public function getCount(): int { return $this->count; } } $counter = new Counter(); $counter->increment(); $counter->increment(); $counter->increment(); $counter->decrement(); echo $counter->getCount(); ?> Output: 2 Notes: - $count is private, so it can only be read or changed by code inside the Counter class itself - there is no way to write $counter->count = 100 from outside the class, forcing every change to go through increment()/decrement(). - Three increment() calls plus one decrement() call nets out to 0 + 1 + 1 + 1 - 1 = 2, exactly matching the final getCount() result. - getCount() is the only way external code can ever read the current value - this is the encapsulation pattern from the chapter, applied to a running total instead of a bank balance.