Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace switch with match #1655

Merged
merged 2 commits into from Apr 19, 2022
Merged

Replace switch with match #1655

merged 2 commits into from Apr 19, 2022

Conversation

hemberger
Copy link
Contributor

The match expression is available as of PHP 8.0 and provides a more
intuitive interface than switch when a single value is returned.

Note that it performs an identity check (===) between the value and
case instead of a weak equality check (==).

https://www.php.net/manual/en/control-structures.match.php

hemberger and others added 2 commits April 18, 2022 07:45
The `match` expression is available as of PHP 8.0 and provides a more
intuitive interface than `switch` when a single value is returned.

Note that it performs an identity check (===) between the value and
case instead of a weak equality check (==).

https://www.php.net/manual/en/control-structures.match.php
@Seldaek Seldaek merged commit e4bb5c5 into Seldaek:main Apr 19, 2022
@Seldaek
Copy link
Owner

Seldaek commented Apr 19, 2022

Thanks

@hemberger hemberger deleted the switch-to-match branch April 19, 2022 20:19
@lyrixx lyrixx mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants