[VOTE] match expression
| From: | Ilija Tovilo | Date: | Sat, 25 Apr 2020 10:39:46 +0000 |
| Subject: | [VOTE] match expression | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-109842@lists.php.net to get a copy of this message | ||
Hi internals
I have opened the voting on the match expression RFC. It will end on
9th of May, 2020.
https://wiki.php.net/rfc/match_expression
Here are the last changes:
In the last update I mentioned allowing return values in blocks.
Unfortunately, we discovered some technical difficulties (memory
leaks) which are very hard to solve. Nikita is experimenting on a
possible solution. There was also a fair bit of backlash over the
syntax. Thus I have decided to move block expressions to a separate
RFC. Note that blocks with just statements remain part of this RFC.
The "duplicate condition" warning mentioned by Dan was removed due to
the arguments made by Tyson.
I have also moved the optional semicolon for the match in statement
form to a separate vote as this was another controversial part of the
proposal.
Furthermore I have added another secondary vote for allowing to drop
(true) conditions as that was suggested multiple times:
match {
$age >= 30 => {},
$age >= 20 => {},
$age >= 10 => {},
default => {},
}
// Equivalent to
match (true) {
$age >= 30 => {},
$age >= 20 => {},
$age >= 10 => {},
default => {},
}
There is a separate poll for specifying the reason for a "no" vote.
Let me know if there are any other reasons so I can add those to the
poll.
A personal thank you goes out to Tyson for his guidance!
Regards,
Ilija