News for hackers. Stuff that matters.
Re:How To Build a 'Dynamic' Config Class in PHP by najafali on Wednesday May 27, 2009 @04:13AM (#628186)
There's no harm in doing it that way. By convention across my classes though I declare properties private and provide access via public getter methods.

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.

Re:How To Build a 'Dynamic' Config Class in PHP by jawngee on Tuesday May 26, 2009 @06:14PM (#627630)
Why would you mock this as a function call and not use __get() so that it shows up as a property:

$config->databaseUrl;

versus

$config->getDatabaseUrl();

?