Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed unsetting from loosely equal keys OrderedHashMap#24566

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.7frommaryo:2.7
Oct 16, 2017
Merged

Fixed unsetting from loosely equal keys OrderedHashMap#24566

fabpot merged 1 commit intosymfony:2.7frommaryo:2.7
Oct 16, 2017

Conversation

@maryo
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#24558
LicenseMIT

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneOct 16, 2017
@fabpot
Copy link
Member

Thank you@maryo.

@fabpotfabpot merged commitba37cba intosymfony:2.7Oct 16, 2017
fabpot added a commit that referenced this pull requestOct 16, 2017
…ryo)This PR was merged into the 2.7 branch.Discussion----------Fixed unsetting from loosely equal keys OrderedHashMap| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#24558| License       | MITCommits-------ba37cba Fixed unsetting from loosely equal keys OrderedHashMap
publicfunctionoffsetUnset($key)
{
if (false !== ($position =array_search($key,$this->orderedKeys))) {
if (false !== ($position =array_search((string)$key,$this->orderedKeys))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wouldn't it have been enough to passtrue as the third argument here?

Copy link
ContributorAuthor

@maryomaryoNov 13, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@xabbuhhttps://3v4l.org/vBboa
When unsetting a numeric string offset likeunset($map['1']),$key equals to integer1. So it's needed to treat these numeric strings the same way as integers. Hence the cast. And since$this->orderedKeys are all strings (the new cast inoffsetSet), passingtrue would result in the same.

This was referencedOct 30, 2017
This was referencedNov 10, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@maryo@fabpot@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp