Re: [Concept] Flip relative function lookup order (global, then local)

From: Date: Fri, 23 Aug 2024 08:52:28 +0000
Subject: Re: [Concept] Flip relative function lookup order (global, then local)
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, 23 Aug 2024, at 08:27, Nick Lockheart wrote:
> Could be mistaken, but I think the way PHP handles namespaces
> internally is sort of the same as a long string, rather than as a
> tree/hierarchy.

Just to be clear, PHP already has a syntax for explicitly resolving a name relative to the current
namespace, it's just not needed very often. See e.g. https://3v4l.org/Xfma5 and https://3v4l.org/3o2TD (You're right that underneath
it's all just string concatenation, but that's all you need in this case.)

All I was talking about was alternative syntax that would behave in exactly the same way that
"namespace\Foo" already does.

-- 
Rowan Tommins
[IMSoP]


Thread (112 messages)

« previous php.internals (#125111) next »