Skip to content

Forbid use of semi-colon on switch case/default statements #128

@Crell

Description

@Crell

These are almost never used, and are now deprecated in PHP 8.5. Let's go ahead and tell people to never use them in any version.

switch ($val) {
  case 1;  // This works until 8.5, who knew?  But we shouldn't allow it.
    print $val;
  case 2:  // This is the correct way.
    print $val * 2;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions