There are several advantages to using getter methods. Already mentioned are formatting, keeping the external interface of the class the same even when the internals change, and debugging. I also use them sometimes for caching if you have a calculated property.
eg
class TestClass
{
private $_cachedTestProperty;
public function __get($varname)
{
switch ($varname)
{
case "testProperty":
if (!isset($this->_cachedTestProperty))
{
$this->_cachedTestProperty = /*calculate property*/
}
return $this->_cachedTestProperty;
break;
}
}
}
If you do this, you will need to remember to unset the cached value if another change to the class renders it obselete
They can also provide read-only access to protected / private variables
As always with these things, whether you want to use a public property or a getter depends on what you are trying to do. They are not always better, its a case of using the right tool for the job