Skip to content

ext/hash: don't emit xxh64 seed deprecation when no seed is given - #24412

Closed
jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-xxh64-seed-deprecation
Closed

jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-xxh64-seed-deprecation

Conversation

@jorgsowa

Copy link
Copy Markdown
Contributor

PHP_XXH64Init() emits the "Passing a seed of a type other than int is deprecated" notice whenever an options array is passed, even if it has no seed key:

hash("xxh64", "x", false, []);
// Deprecated: hash(): Passing a seed of a type other than int is deprecated because it is the same as setting the seed to 0

xxh32, xxh3 and xxh128 don't do this. The xxh64 check was if (seed && IS_LONG == Z_TYPE_P(seed)) … else deprecate, so a missing seed fell into the else branch. This PR nests the check the same way as in PHP_XXH32Init().

Introduced in #15236 (74eff98), so 8.4 is the first affected version.

@jorgsowa
jorgsowa marked this pull request as ready for review October 18, 2026 16:35

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thx

@jorgsowa jorgsowa closed this in 17f94f0 Oct 19, 2026
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.

2 participants