Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Fix OrderedHashMap auto-increment logic with mixed keys#63144

Merged
nicolas-grekas merged 1 commit into
symfony:6.4from
yoeunes:fix-ordered-hash-map-keys-6.4
Jan 22, 2026
Merged

[Form] Fix OrderedHashMap auto-increment logic with mixed keys#63144
nicolas-grekas merged 1 commit into
symfony:6.4from
yoeunes:fix-ordered-hash-map-keys-6.4

Conversation

@yoeunes
Copy link
Copy Markdown
Contributor

@yoeunes yoeunes commented Jan 21, 2026

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

When OrderedHashMap has mixed integer and string keys, appending a new element overwrites existing integer keys instead of generating a new key:

$map = new OrderedHashMap();
$map[0] = 'zero';
$map[1] = 'one';
$map['foo'] = 'bar';
$map[] = 'new'; // overwrites key 1 instead of creating key 2

@carsonbot carsonbot added this to the 6.4 milestone Jan 21, 2026
@OskarStark OskarStark changed the title [Form] Fix OrderedHashMap auto-increment logic with mixed keys [Form] Fix OrderedHashMap auto-increment logic with mixed keys Jan 21, 2026
Comment thread src/Symfony/Component/Form/Util/OrderedHashMap.php Outdated
@nicolas-grekas nicolas-grekas force-pushed the fix-ordered-hash-map-keys-6.4 branch from 81ab704 to 10f9f01 Compare January 22, 2026 20:17
Copy link
Copy Markdown
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(I fixed another bug in the same code)

@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @yoeunes.

@nicolas-grekas nicolas-grekas merged commit 0e7c9fb into symfony:6.4 Jan 22, 2026
10 of 12 checks passed
@yoeunes
Copy link
Copy Markdown
Contributor Author

yoeunes commented Jan 23, 2026

Thank you @nicolas-grekas 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants