I'm a novice with OOP, and I'm having trouble grasping the necessity of a getter method.
In the example:
class foo {
$this->bar = "test";
}
$foo = new foo();
echo $foo->bar;
What are the potential pitfalls in this situation, assuming I'm using a setter method to properly validate an updated value?