
Let's usematch
expression with PHP 8.0 💪 Lets' see when to use it and why it can have advantages over the old goodswitch
statement.match
will indeed make your code cleaner, less verbose and easier to read 💥
Furthermore, with the “https://php.watch/versions/8.0/match-expression” expression, you can have multiple matching conditions separated by commas, like
$sMessage=match($sDayPrefix){'Sat','Sun'=>'Enjoy your weekend!',};
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse