Re: [RFC Draft] Introduce wit h as an alias for namespace use keyword

From: Date: Sat, 24 May 2025 09:49:32 +0000
Subject: Re: [RFC Draft] Introduce wit h as an alias for namespace use keyword
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On 24 May 2025 10:08:46 BST, "马正强" <[email protected]> wrote:
>Hello internals,
>
>I’d like to propose adding with as a full alias for the namespace-related
>use keyword in PHP.
..
>   - Does this improvement warrant an RFC?
>   - Are there objections to the concept or keyword choice?

It would certainly need an RFC in order to add, because it's a core language change. Adding a
new keyword generally requires reserving it in at least some contexts, so the backward compatibility
impact would need to be made clear in any RFC as well. 

Personally, though, I don't see any advantage at all. Both keywords seem equally arbitrary, and
the existing syntax has been established for over a decade at this point. Having two ways to write
the same thing is likely to confuse new users about whether they do different things, and there
won't be any incentive for existing code to change from one to the other, especially since they
won't be able to for several years if they support multiple PHP versions. 

As for other languages, they use all sorts of different keywords for the same or similar features,
e.g. "import" and "using", so it's not like PHP is a weird outlier here.

Regards,
Rowan Tommins
[IMSoP]


Thread (3 messages)

« previous php.internals (#127440) next »