Given the strong opposition of core devs against this feature in the past, I 
want a vote on the RFC before I start working on a patch.

Before this vote can take place, as you note, we need to solve the function 
fallback issue: in theory, we should call the autoloader before looking into 
the global namespace, but, in practice, most function calls reference PHP 
internal functions, and the performance hit would be too big. Forcing people to 
prepend a '\' to every function calls is also not possible. So, the only 
remaining solution, IMO, is to call the autoloader (first with NS suffix, then 
global) AFTER a global function lookup. In this case, we must accept that 
namespaced functions named the same as a global function may be incorrectly 
ignored in some cases.

François

> -----Message d'origine-----
> De : Benjamin Eberlei [mailto:kont...@beberlei.de]
> Envoyé : jeudi 8 novembre 2012 11:53
> À : PHP Internals
> Objet : [PHP-DEV] Autoload Functions RFC in 5.5?
> 
> There is this wonderful RFC sitting around:
> 
> https://wiki.php.net/rfc/autofunc
> 
> Is there any chance that we can integrate this in 5.5 and somebody is
> willing to write this patch?
> 
> The only topic missing from the RFC is how the fallback to global
> namespace works, if the autoloader is called before or after the
> fallback.
> 
> greetings,
> Benjamin

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to