On 08/08/2016 17:23, Niklas Keller wrote:
Loading only full qualified names will lead to strange bugs.

The suggestion is to require *qualified* names (at least one \ in the call), not to require *fully qualified* names (leading \ and full namespace path). Function name resolution already requires that to reference anything other than a global function, or the exact current namespace.

The only scheme I can think of where it would matter is one-function-per-file, like Smarty's plugin loader.

# file foo.php
namespace Acme\Plugins;
function foo() { echo 'Hello world'; }

# file bar.php
namespace Acme\Plugins;
function bar() { foo(); } # will not autoload


Compared to "hundreds of lines of existing code will go slowly unless you liberally sprinkle with \", having to remind people not to do that seems like a small price to pay.


Regards,
--
Rowan Collins
[IMSoP]

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

Reply via email to