Skip to content

Fix spl_object_hash collision by segmenting hash db with class name - #200

Closed
crazycodr wants to merge 1 commit into
myclabs:1.xfrom
crazycodr:fix-spl-object-hash-collision
Closed

Fix spl_object_hash collision by segmenting hash db with class name#200
crazycodr wants to merge 1 commit into
myclabs:1.xfrom
crazycodr:fix-spl-object-hash-collision

Conversation

@crazycodr

Copy link
Copy Markdown

We found an issue today at work with DeepCopy 1.11.1 which seems to be related to #180. It took me quite a good amount of time to figure this out but I hit the same problem.

There will probably never be two hashes similar for the same class but evidence from my environment shows there CAN be similar hashes across different classes.

The solution is simple, segment the hash database in memory with a class name and the problem goes away. Simple and efficient.

I did not add tests as there is not easy way to reproduce this and the hash provider we use is not a dependency we can inject.

@mnapoli

mnapoli commented Aug 11, 2026

Copy link
Copy Markdown
Member

Fixed by #211

@mnapoli mnapoli closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants