Thank you Alecks, your method seemed to do the work. Only thing to note though, is that in your test you've included all of the classes, but in-fact __autoload will only include the needed ones. The require_once approach will included all of the files needed throughout the class, __autoload will only create the ones needed by the specific workflow (functions, conditions, etc.). For example, let's consider the following class:
class ClassName() {
function Func1() {
// uses class1.php
}
function Func2() {
// uses class2.php
}
function Func3() {
// uses class3.php
}
}
If we only execute ->Func3(), autoload will only include class3.php, require_once will include all three files.
keebB, regarding the debugging issue, I just suggest extremely secure code. The function should throw detailed exceptions about every little issue (class in array, file exists, include failed, class exists, anything else?), making it impossible to miss anything.
Overall I agree with aschk, that when it comes to maintainability and rapid development, __autoload is a great tool, even at the expense of a minor performance reduction. Only problem I see with coding practices with __autoload, is that a careless programmer might use too many different classes for simple operations that doesn't really require all of these classes. With require_once you can't miss the fact that you need to use a different class file and with __autoload it's easy to get forgetful. Makes sense?