Error Trail · Level 6 of 8

No arm to land on

A match with no arm for 500, and one with a default.

<?phpfunction label(int $code): string {    return match ($code) {        200 => 'ok',        404 => 'missing',    };}function safe(int $code): string {    return match ($code) {        200 => 'ok',        default => 'other',    };}echo label(200), "\n";try {    echo label(500), "\n";} catch (\UnhandledMatchError $e) {    echo get_class($e), "\n";}echo safe(500), "\n";

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…
  3. 3…