Re: [RFC][Discussion] use construct (Block Scoping)
| From: | Rob Landers | Date: | Tue, 04 Nov 2025 14:03:29 +0000 |
| Subject: | Re: [RFC][Discussion] use construct (Block Scoping) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129072@lists.php.net to get a copy of this message | ||
On Tue, Nov 4, 2025, at 14:59, Rob Landers wrote:
> On Mon, Nov 3, 2025, at 22:46, Seifeddine Gmati wrote:
>> Hello internals,
>>
>> Tim and I would like to open the discussion on our new RFC that we've been working on:
>> "use construct (Block Scoping)".
>>
>> We wanted to raise a few initial points:
>>
>> • The RFC proposes the `
use keyword.
>> What are your thoughts on a new using` keyword
>> instead, similar to C# or Hack?
>>
>> • How do you feel about the questions raised in the "Open Issues" section?
>>
>> • What are your general thoughts on the RFC?
>>
>> Please find the following resources for your reference:
>>
>> • RFC: https://wiki.php.net/rfc/optin_block_scoping
>>
>> • POC:
>> https://github.com/php/php-src/compare/master...TimWolla:php-src:block-scope
>>
>> Thanks,
>>
>> Seifeddine Gmati.
>>
>
> Hello,
>
> One thing that isn't clear with this RFC is what happens to things redefined in the scope?
>
> $a = 10;
>
> use ($a = 5) {
> var_dump($a);
> }
>
> var_dump($a); // unset or 10?
>
> — Rob
lol, I just saw "open issues" ... so, never mind. I like option B.
— Rob