Re: [Concept] Flip relative fu nction lookup order (global, then local)
| From: | Rowan Tommins [IMSoP] | Date: | Fri, 23 Aug 2024 08:16:26 +0000 |
| Subject: | Re: [Concept] Flip relative fu nction lookup order (global, then local) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125110@lists.php.net to get a copy of this message | ||
On 23 August 2024 01:42:38 BST, Nick Lockheart <lists@ageofdream.com> wrote:
>
>>
>> BUT, if people already complain about "\" being ugly, having to write
>> "namespace\" is going to make them REALLY grumpy...
>> So maybe at the same time (or, probably, in advance) we need to come
>> up with a nicer syntax for explicitly referencing the current
>> namespace.
>
> namespace foo using global functions;
>
> - or -
>
> namespace foo using local functions;
>
>
>Tell PHP what you want at the per-file level.
This doesn't seem mutually exclusive to me. If you have a file where you've opted for
"using global functions", you might want a way to reference a function in the current
namespace.
It also doesn't address my other point, that having global as the default mode (even if we
provide an option for local) is much less disruptive to existing code.
Regards,
Rowan Tommins
[IMSoP]