1 points · by najafali · 17y ago · 2 comments
The reason I use getters instead of direct access to properties (especially in PHP) is you can hide a lot of laziness behind them (i.e. database runs, object initialization etc) while at the same time providing a consistent interface to client code.
$config->databaseUrl;
versus
$config->getDatabaseUrl();
?