Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/hash/hash_xxhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ zend_always_inline static void _PHP_XXH3_Init(PHP_XXH3_64_CTX *ctx, HashTable *a
return;
} else if (_secret) {
if (IS_STRING != Z_TYPE_P(_secret)) {
php_error_docref(NULL, E_DEPRECATED, "Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs");
php_error_docref(NULL, E_DEPRECATED, "Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs");
}
zend_string *secret_string = zval_try_get_string(_secret);
if (UNEXPECTED(!secret_string)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/tests/xxh3_convert_secret_to_string.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ try {
var_dump($x);
?>
--EXPECTF--
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
array(1) {
["secret"]=>
int(4)
Expand Down
4 changes: 2 additions & 2 deletions ext/hash/tests/xxhash_secret.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ foreach (["xxh3", "xxh128"] as $a) {
--EXPECTF--
string(67) "xxh3: Only one of seed or secret is to be passed for initialization"

Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
string(23) "exception in __toString"
string(57) "xxh3: Secret length must be >= 136 bytes, 17 bytes passed"
8028aa834c03557a == 8028aa834c03557a == true
string(69) "xxh128: Only one of seed or secret is to be passed for initialization"

Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
string(23) "exception in __toString"
string(59) "xxh128: Secret length must be >= 136 bytes, 17 bytes passed"
54279097795e7218093a05d4d781cbb9 == 54279097795e7218093a05d4d781cbb9 == true
4 changes: 2 additions & 2 deletions ext/hash/tests/xxhash_seed_deprecation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Deprecated: hash_init(): Passing a seed of a type other than int is deprecated b

Deprecated: hash_init(): Passing a seed of a type other than int is deprecated because it is ignored in %s on line %d

Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d

Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d