In your example the benefits are not really apparent due to getters and setters are usually for getting/setting information from external code though they can be used for internal ones but it is less important.
Allowing direct access to internal properties of an object means anyone who uses your class is as the mercy of you changing the objects internal structure due to the tight coupling.
Originally we write a class that has a getter and setter for a. a originally holds a simple type such as number or a string etc.
ie.
class Test
{
var $a;
function SetA( $a )
{
$this->a = $a;
}
function GetA()
{
return $this->a;
}
}
Now the functionality of the class grows and you want to set a to an object and call a trigger( DoSomethingWithNewA() ) due to refactoring. The class now becomes
class Test
{
var $a;
function SetA( $a )
{
$this->a = new Dummy($a);
$this->DoSomethingWithNewA();
}
function GetA()
{
return $this->a->GetValue();
}
function DoSomethingWithNewA()
{
//refresh an setting reliant on old a etc..
}
}
Anyone who was calling your value $test->a directly is now buggered and anyone who was calling $test->GetA() isn't . Though unless you are using php5 you cannot force them not to directly access things due to lack or public, private and protected.
http://www.zend.com/php5/articles/engine2-php5-changes.php
Worth a read...
Using setters internally does allow you not to worry about any trigger code you might put in the setter etc but as the class is your code you can deal with it internally as you wish so is not such a big deal.