On Thu, Jan 15, 2026, at 9:52 AM, Tim Düsterhus wrote:
> Hi
>
> Note: I've not been able to fully work through the ML discussion and 
> meaningfully think about all the commentary. This includes some of the 
> older emails. I have also not yet given the RFC an in-depth read, like I 
> would have normally done.
>
> Some (incomplete) notes for now:
>
> Am 2026-01-13 23:19, schrieb Larry Garfield:
>> Once those issues are addressed, I think we're nearly able to take CMs 
>> to a vote.  (If anyone else wants to weigh in on some other part as 
>> well, even if it's just a voice of support/approval, now is the time.)
>
> Something that I had noted in response to Rowan in the (what you call) 
> “Bonus Thread” in https://news-web.php.net/php.internals/129582 and also 
> in this RFC's discussion in 
> https://news-web.php.net/php.internals/129618 and what was also 
> mentioned by Marco Deleu in 
> https://news-web.php.net/php.internals/129083 and what I feel is neither 
> properly justified within the RFC text and as far as I can tell was not 
> really discussed either:
>
> The fact that `break;` and `continue;` target `using()` blocks. To me it 
> violates the principle of least surprise that
>
>      foreach ($users as $user) {
>          using (new SuppressErrors()) {
>              if ($user->isAdmin()) {
>                  $firstAdmin = $user;
>                  break;
>              }
>          }
>      }
>
> is incorrect code. The RFC just states *that* this will happen as a 
> fact, but does not attempt to explain *why* that decision was made and 
> neither are there any examples showcasing how that could be useful.

The core point here is that we needed some way to successfully terminate the 
block early, and `return` was already taken by the function.  `break` seemed 
like the obvious keyword to use, as in other contexts it also means "skip to 
the end of this block."  

`continue` is really just to mirror what switch does with it.  If the consensus 
is to simply disallow `continue` entirely (which is inconsistent with what 
switch does today), we're OK with that.  I don't feel strongly either way, so 
we're looking for a consensus.

If there's a different keyword than `break` you think would make more sense 
here, please do suggest it and provide an argument.  But "break does the same 
thing here it does in switch, foreach, and while" seems like a pretty 
straightforward approach.

> I'd also like to note that there's also an “Open Issue” listed in the 
> RFC that is related to this topic.
>
> ---------------
>
> With regard to the desugaring listed at the top: Can you please also 
> provide the desugaring for the case where no context variable is 
> specified for completeness?

Desugaring at the top?  The desugaring is explained about a third of the way 
down. :-)  Is that what you mean?  (In the "Implementation" section.)  It 
doesn't make any sense to go into that level of detail in the introduction.

--Larry Garfield

Reply via email to