[php-src] master: Merge branch 'PHP-8.4' into PHP-8.5
| From: | Jorg Sowa | Date: | Mon, 19 Oct 2026 10:13:59 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142433@lists.php.net to get a copy of this message | ||
Author: Jorg Sowa (jorgsowa)
Date: 2026-10-19T12:12:43+02:00
Commit: https://github.com/php/php-src/commit/a2d7bd615117863db591d0d706ee96487cbbfdb1
Raw diff: https://github.com/php/php-src/commit/a2d7bd615117863db591d0d706ee96487cbbfdb1.diff
Merge branch 'PHP-8.4' into PHP-8.5
Changed paths:
A ext/hash/tests/xxhash_options_without_seed.phpt
M ext/hash/hash_xxhash.c
Diff:
diff --git a/ext/hash/hash_xxhash.c b/ext/hash/hash_xxhash.c
index 690b5489c7ef..0f304abb3e66 100644
--- a/ext/hash/hash_xxhash.c
+++ b/ext/hash/hash_xxhash.c
@@ -115,11 +115,13 @@ PHP_HASH_API void PHP_XXH64Init(PHP_XXH64_CTX *ctx, HashTable *args)
zval *seed = zend_hash_str_find_deref(args, "seed", sizeof("seed") - 1);
/* This might be a bit too restrictive, but thinking that a seed might be set
once and for all, it should be done a clean way. */
- if (seed && IS_LONG == Z_TYPE_P(seed)) {
- XXH64_reset(&ctx->s, (XXH64_hash_t)Z_LVAL_P(seed));
- return;
- } else {
- php_error_docref(NULL, E_DEPRECATED, "Passing a seed of a type other than int is deprecated
because it is the same as setting the seed to 0");
+ if (seed) {
+ if (IS_LONG == Z_TYPE_P(seed)) {
+ XXH64_reset(&ctx->s, (XXH64_hash_t)Z_LVAL_P(seed));
+ return;
+ } else {
+ php_error_docref(NULL, E_DEPRECATED, "Passing a seed of a type other than int is
deprecated because it is the same as setting the seed to 0");
+ }
}
}
diff --git a/ext/hash/tests/xxhash_options_without_seed.phpt
b/ext/hash/tests/xxhash_options_without_seed.phpt
new file mode 100644
index 000000000000..87660f1f57fc
--- /dev/null
+++ b/ext/hash/tests/xxhash_options_without_seed.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Hash: xxHash options without a seed do not emit a deprecation
+--FILE--
+<?php
+
+foreach (["xxh32", "xxh64", "xxh3", "xxh128"] as $a) {
+ var_dump(hash($a, "x", options: []) === hash($a, "x"));
+}
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)