2008/10/27 Stanislav Malyshev <[EMAIL PROTECTED]>: >> Then, if we assume that most people will use the global namespace >> without prefixing it, what would be the best resolution order for >> them? (you didn't mention it in your previous message) > > Using the prefixed names.
I'm sorry but I still don't get what's your "right" way to do it. For reference, the "wrong" way is: >> 1) check for namespaced\classname >> 2) try to autoload namespaced\classname >> 3) check for internal classname How would you reorder those? > I consider knowingly putting performance bomb into the language with the > reasoning of "if you know what you are doing, you can disarm it" extremely > bad idea, especially in PHP which is supposed to be low-learning-curve > language. You keep throwing that "performance bomb" thing even though there is no benchmark about it. You are speculating that people will have huge librairies with autoloads that search for files inside the include_path. Is it wise to base the resolution order on those speculations? >> Include + relative path does not give any indication either and it >> does exactly what you've described above (traverse the full include > > Include can be cached. Failed autoload can't. ...but didn't you say "one time is enough"? According to your own logic, include is a "performance bomb" as well. My point is that your base scenario is simply not realistic. Only the biggest websites need to perform without touching the disk. Only some very complicated framework will autoload classes outside of their directory and attempt to traverse the include path for some reason. Those are fringe cases, and all they need to do to perform efficiently is prepend the class names with \ or fix their autoloader. On the other hand, changing the resolution order to prefer internal classes over autoloading induces a loss of functionality that can only be fixed by explicitly including the needed files in advance, defeating the purpose of an autoloader. Anyway, I feel like I've made my point, the discussion isn't progressing and my arguments have already been rehashed in past discussions so I'll probably rest my case. Thanks for reading ;) -JD -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php