This member of the peanut gallery would like to point out the following danger. Consider the following function collection for namespace A.
namespace A; function strpos() {} function myfunc() {} Now if I understand the RFC correctly there's an unintuitive problem as follows - if myfunc is called first, strpos gets redefined for that namespace and functions as the author might expect for the namespace. If strpos gets called first then it will behave as it does in the global namespace, which may or may not be desirable. In any event, from where I stand here in userland, this is potentially confusing. I'm an amateur of the 1st degree, but my gut tells me that the behavior state of any given function should NOT be determined by whether or not a different function was invoked before it. On Mon, Aug 15, 2011 at 5:49 PM, Chris Stockton <chrisstockto...@gmail.com>wrote: > Hello Stas, > > On Mon, Aug 15, 2011 at 1:26 AM, Stas Malyshev <smalys...@sugarcrm.com> > wrote: > > Hi! > > It's not a shortcoming, it was designed that way, and for very serious > > reasons. If you want to know the reasons, there were discussed > extensively > > when namespaces were discussed. Please re-read that discussion. And all > > things you propose now were already discussed back then too. If you hope > > people would write \strlen instead of strlen, this discussion is > pointless > > because it won't happen. > > -- > > I see your viewpoint from a architectural/design perspective and they > are valid, but I think the impact and design could be lightened with > some simple rules of precedence. > > I think it would be fair to say, autoloader will not be called on a > function like strpos, or any builtin compiled extension. Only once > those are cycled through will autoloader for functions be called. At > this point the performance penalty doesn't exist, because at this > point the program execution would have halted with a fatal error > anyways. > > -Chris > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >