PHP 7.3: Use break instead of continue within a switch case#10037
Merged
PHP 7.3: Use break instead of continue within a switch case#10037
Conversation
Starting in PHP 7.3 (currently in Beta 2), PHP will throw a warning when using `continue` within a `switch` to confirm intent. In PHP, within `switch`, `break` and `continue` do the same thing while in other languages `continue` would behave like PHP's `continue 2`. This would preserve the same behavior and avoid the warning. See https://github.com/php/php-src/blob/php-7.3.0beta2/UPGRADING
Collaborator
|
That's a great PR description, thank you so much for your effort! Generated by 🚫 dangerJS |
zinigor
added a commit
that referenced
this pull request
Aug 31, 2018
zinigor
added a commit
that referenced
this pull request
Aug 31, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting in PHP 7.3 (currently in Beta 2), PHP will throw a warning when using
continuewithin aswitchto confirm intent. In PHP, withinswitch,breakandcontinuedo the same thing while in other languagescontinuewould behave like PHP'scontinue 2.This would preserve the same behavior and avoid the warning. See https://github.com/php/php-src/blob/php-7.3.0beta2/UPGRADING
Based on the current timeline, this would need to land no later than our December release (6.8 based on our monthly clip). PHP 7.3 is expected to go into GA on December 13th. Since this is a backwards compatible change, no reason to wait though.
Testing instructions:
Proposed changelog entry for your changes: