So me and my good pal Oren
I read the docs and I must say I'm not overly impressed with the idea of __autoload()
For starters, I'm trying to think how PHP would implement such functionality...
It parses all code in every file directly referenced...it detects any classes which haven't been defined and uses those names to include() a class interface/implementation...???
How does it locate these files? I assume it must recursively scan the entire directory looking for a filename that matches the classname??? what if the classname and the file names are not named exactly alike? For instance, I use lower case letters for my filenames and camelcase for class names...???
So there is a performance implication in using __autoload() I would think...???
That file which contains __autoload() and the class definietion could be stored *anywhere* so how else does PHP find that file???
Ok I just had an epiphany
__autoload() is not a member function, but it appears to be a global magic function...which the scripting engine calls...whenever it stumbles across an undefined class
So there goes my argument for performance issues...
But still the spaghetti code issue...and forcing of conventions when naming your class exactly as you would the name of your class filename...the second is probably not important to anyone but me, but the spaghetti code...???
I suppose inside the __autoload() I could convert camelcase to filename convention...
But there goes any include() information for auto-documentors...
Plus, the dynamic nature of it all really hides details from you, making it possibly difficult to locate where and when an object was included (maybe not when cuz that's obvious)...??
I don't know how many of you used GOTO: back in the day, but I did, as it's conveinent(sp?) but sooner or later you realize that it's not the best way to do things, at least for large project longevity/readability, etc...
Opinions, thought, etc???