-
Notifications
You must be signed in to change notification settings - Fork 764
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
Match expressions doesn't need always to be terminated by a semicolon #4402
Conversation
https://www.php.net/manual/en/language.expressions.php I'm not sure why we repeat that information on the |
A <literal>match</literal> expression <emphasis>must</emphasis> be | ||
terminated by a semicolon <literal>;</literal>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just rephrasing the existing note to
When a match expression is used as a standalone expression it must be terminated by a semicolon.
Covers the nuance just fine without needing to add examples.
You could use a match expression as a function argument, and you don't need a semi colon there either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we go then!
2f3f696
to
1600ba8
Compare
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
I'm not sure if this PR is important for the documentation, but "match" doesn't always need to be terminated by a semicolon.
I've learned this today :)