Skip to content

Update switch docs for new == rules #1196

Open
@lexidor

Description

@lexidor

Please complete the information below:

Where is the problem?

$v = 30;
switch ($v) {
case 30.0:  // <===== this case matches with 30
  ...
  break;
default:
  ...
  break;
case 30:    // <===== rather than this case matching with 30
  ...
  break;
}

What is the problem?

30 and 30.0 are not considered equal under the new == equality operator.


Please don't change anything below this point.


  • Build ID: HHVM=HHVM-4.154.0:HSL=v4.108.1:2022-04-04T22:45:12+0000:1fa47f258c6b68f8ec01899aa82fd6ffa0957109
  • Page requested: /hack/statements/switch
  • Page requested at: Tue, 05 Apr 2022 20:05:23 +0000

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions