The Match Expression feature is interesting. According to the PHP docs, it can even handle non-identity expression, although the approach seems a little hacky:
https://www.php.net/manual/en/control-structures.match.php#e...
<?php
$age = 23;
$result = match (true) {
$age >= 65 => 'senior',
$age >= 25 => 'adult',
$age >= 18 => 'young adult',
default => 'kid',
};
The above example will output: string(11) "young adult"