News for hackers. Stuff that matters.
Re:What's new in PHP 8? by kyleee on Thursday August 13, 2020 @09:41PM (#24152221)
for some reason (probably a bad one) i love switch statements and i look forward to the match expression
Re:What's new in PHP 8? by __sisyphus__ on Thursday August 13, 2020 @11:19PM (#24152889)
for whatever reason (also probably a bad one), i hate the syntax of switch statements, and for that reason i almost never use them. the match expression though, i'm actually very excited about. i quite like the mapped look; it seems more intuitive to read.
Re:What's new in PHP 8? by systematical on Friday August 14, 2020 @12:21AM (#24153337)
nothing wrong with switch statements.
Re:What's new in PHP 8? by zowanet on Friday August 14, 2020 @03:47AM (#24155038)
Coerced-typed (weak) comparisons and easy accidental fallthrough are the problems commonly associated with switch statements.

The new match construct fixes both of these and is also an expression instead of a statement, allowing for more expressive code.