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

Use strcmp instead of spaceship operator to compare objects #75

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

tomdrissen
Copy link

Use strcmp instead of spaceship operator to prevent some weird behaviour when comparing hashes with more than 16 characters, see issue #71 .

@tomdrissen
Copy link
Author

Something gone wrong while rebasing the changes in PR #74 so I've created a new PR for the 3.2.x branch @driehle.

@driehle driehle added this to the 3.2.1 milestone Feb 6, 2023
@driehle driehle added the Bug Something isn't working label Feb 6, 2023
@driehle driehle linked an issue Feb 6, 2023 that may be closed by this pull request
@driehle driehle self-assigned this Feb 6, 2023
@driehle driehle force-pushed the bugfix/compare-objects branch from 1bfa263 to 1aca22f Compare February 6, 2023 09:05
@driehle driehle force-pushed the bugfix/compare-objects branch from 86a1de1 to ab1def6 Compare February 6, 2023 09:13
Copy link
Member

@driehle driehle left a comment

Choose a reason for hiding this comment

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

Looks good. I tried to come up with a failing test case, but since SPL object hashs are different on every run and, in general, purely numeric hashes seem to be scarce, it wasn't possible to add such a test case.

Therefore, let's go with it as it is. In the code, I added a comment with the link to the issue on php-src that Tom created.

@driehle driehle merged commit 8461089 into doctrine:3.2.x Feb 6, 2023
@driehle
Copy link
Member

driehle commented Feb 6, 2023

Thanks, @tomdrissen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with the compare function of the AbstractCollectionStrategy
2 participants