Re: Opt-in "use function *;" for skipping check for function/const in alternate namespace
| From: | Rowan Tommins | Date: | Thu, 28 Nov 2019 09:35:27 +0000 |
| Subject: | Re: Opt-in "use function *;" for skipping check for function/const in alternate namespace | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107879@lists.php.net to get a copy of this message | ||
On Thu, 28 Nov 2019 at 00:02, tyson andre <tysonandre775@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.
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 ¯\_(ツ)_/¯
Regards,
--
Rowan Tommins
[IMSoP]