Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Conversation

crazycodr
Copy link

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.

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.

2 participants