This repository was archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
php 7.3 compat: continue targeting switch equaivalent to break; #91
Merged
Conversation
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
actually, break should be enough as it not break the loop, but break the case itself, except, we use |
weierophinney
suggested changes
Jul 9, 2018
src/ArrayObject.php
Outdated
@@ -425,7 +425,7 @@ public function unserialize($data) | |||
$this->setIteratorClass($v); | |||
break; | |||
case 'protectedProperties': | |||
continue; | |||
continue 2; |
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.
Honestly, this is more confusing, as it implies there are two loops, when, in this case case, it's actually a switch
inside a foreach
.
Let's make this a break
instead, please, as that will achieve the same result: continuing on to the next item in the loop.
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.
updated
Closed
weierophinney
added a commit
that referenced
this pull request
Aug 28, 2018
weierophinney
added a commit
that referenced
this pull request
Aug 28, 2018
Thanks, @samsonasik |
Closed
13 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Provide a narrative description of what you are trying to accomplish:
in PHP 7.3.0-dev ( nightly )
It is inside
ArrayObject
class which thecontinue
code called inside switch inside loop.It got error: "
E_WARNING
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?"usingusing break; to jump to next loop.continue 2
master
branch, and submit against that branch.without this patch, the test should failure.
CHANGELOG.md
entry for the fix.