新版本的变更 / PHP 8.0

// *** before: ***
switch (true) {
    case $status === 200:
        $label = 'OK';
        break;
    case $status === 404:
        $label = 'Not found';
        break;
    default:
        $label = 'Unknown';
}

// *** in version 8.0: ***
$label = match (true) {
    $status === 200 => 'OK',
    $status === 404 => 'Not found',
    default => 'Unknown',
};
// match compares strictly and never falls through