> Le 28 nov. 2019 à 10:35, Rowan Tommins <rowan.coll...@gmail.com> a écrit :
> 
> On Thu, 28 Nov 2019 at 00:02, tyson andre <tysonandre...@hotmail.com> wrote:
> 
>> - Due to the absence of function autoloading (not supported in php to
>> performance overhead), functions outside the global scope are rare in
>> practice.
>> 
> 
> 
> If this is a valid justification, perhaps we should do the opposite of the
> "deprecate fallback to global scope" RFC you mentioned, and make the "use
> function *" behaviour the default in some future version. That would
> provide us longer term benefits, such as being able to introduce function
> autoloading.

I think it is better to keep the language as regular as possible, and consider 
that every non-fully-qualified name is relative to the current namespace, 
unless there is an explicit `use` declaration that says otherwise

> 
> An opt-in mechanism is certainly easier to migrate to, but it would be a
> shame if every PHP file in 10 years time included a line like this:
> 
> use function *; // don't know what this does, but apparently it's good for
> performance ¯\_(ツ)_/¯

Or: “don't know what this does, but apparently it silences deprecation 
notices...”

The issue indeed is that the meaning is far from self-evident. Maybe one could 
use something that everyone and their mother could understand at first reading, 
such as:

use function from global namespace;

—Claude

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

Reply via email to