-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Deprecate semicolons after case in switch statement #15258
Comments
This syntax can be used when using plain PHP templates, e.g. https://3v4l.org/7mKS8. While I would not recommend to use switch statements in such templates, some code might still rely on that, so I think dropping support for semicolons after case requires an RFC. |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
Don't close it. |
Is anyone going to pursue the RFC process? |
I'm interested in making an RFC, if someone can assist with the implementation. |
The implementation might be as simple as removing this line: php-src/Zend/zend_language_parser.y Line 716 in 96d1cd0
Anyhow, I suggest that you write to mailing list to gauge some opinions. |
There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests. |
Don't close |
Just cross-linking that this was added to the general 8.5 deprecations RFC (https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement) and the discussion thread was at https://externals.io/message/126000 |
Description
Hello everyone 👋
Did you know that...
This has been working since at least PHP 4: https://php-legacy-docs.zend.com/manual/php4/en/control-structures.switch
I had never seen syntax like this until I accidentally wrote it myself. The resulting code confused everyone.
IMO, this syntax doesn't have benefits and can lead to mistakes. Therefore, I propose to deprecate it and remove it from future versions.
The text was updated successfully, but these errors were encountered: