找出 switch 分支里的 bug

来自 PHP 语言基础
PHP 8.3.33 入门 4分钟 找出 1处问题

为什么 labelStatus 传入 paid 时会返回 closed?

php
<?php
function labelStatus(string $status): string
{
    $label = 'unknown';
    switch ($status) {
        case 'paid':
            $label = 'ready';
        case 'cancelled':
            $label = 'closed';
            break;
    }
    return $label;
}
在试验场中打开
报告错误