Hi
I just became aware of a mistake in the desugaring at the start of the
proposal section:
The value of `$c` was not correctly kept after breaking the reference
with `unset($c)`. This was fixed by adding a `$c = $c_original;`. The
"Simple example" in the Examples section already correctly represented
the intent with the `$b` variable, where it still is `"original b"`
within the `let()` block.
I have also clarified in the desugaring that when the original values
are restored after the block that the restored values will become a
reference again if it originally was a reference. As far as I am aware
this is not representable purely with PHP code, so it's just noted in
the comment.
Diff is at:
https://wiki.php.net/rfc/optin_block_scoping?do=diff&rev2%5B0%5D=1763913496&rev2%5B1%5D=1765398288&difftype=sidebyside
Best regards
Tim Düsterhus