Re: [RFC][Discussion] use construct (Block Scoping)

From: Date: Tue, 04 Nov 2025 09:28:04 +0000
Subject: Re: [RFC][Discussion] use construct (Block Scoping)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129065@lists.php.net to get a copy of this message
Hello all!

Thank you for the RFC, it has been missing for many years.
If I understand correctly, are you proposing to call unset at the
end of the block?

I see that the **Future Scope** section mentions Disposable.
But if your goal is to introduce behavior based on Disposable,
wouldn’t that conflict with the logic of the current RFC?
I see a clear pitfall here.

If you accept this RFC with the unset operation, you will later need
a new keyword for Disposal, because these are two entirely different
scenarios.
(Should I explain why?)

In this context, I also see a problem, as if the RFC is trying to
introduce two different features into the language:

1. **Scope** – a visibility area. It is the scope that has the unset logic.
2. **Using** – a guaranteed call of a disposal function.

Because of this, logical issues are likely to arise. If the RFC’s goal
is unclear and it tries to cover both tasks, the solution risks losing
its clarity.

P.S.
Regarding the questions in the Open Issues, option A seems to have
more explicit behavior than option B.

---
Best Regards, Ed


Thread (42 messages)

« previous php.internals (#129065) next »