I think of it like this, say you add a new class xxxwhatever.php
you have to put in the __construct portion
include 'xxxwhatever.php
then
$this->xxxwhatever = new xxxwhatever;
this takes out the need for more lines of mentioned above, instead adding a variable
$class['xxxwhatever'] = 'xxxwhatever';
say you have
system
security
usersys
language
gzip / or something
content for uploads / posts
it adds up after a while
and would be:
include 'modules/system.php';
$this->system = new system;
include 'modules/security.php';
$this->security = new security;
include 'modules/usersys.php';
$this->usersys = new usersys;
include 'modules/language.php';
$this->language = new language;
include 'modules/gzip.php';
$this->gzip = new gzip;
include 'modules/content.php';
$this->content = new content;
12 in comparison to
@include 'classes.php';
reset($class);
while (list($key, $val) = each($class)) {
@include 'modules/' . $val . '.php';
$this->$val = new $val;
}
6 lines
You're reducing code length for new classes by 50% if you have huge platforms to write like I do.