Skip to content

Commit f6e296d

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix GH-11180: hash_file() appears to be restricted to 3 arguments
2 parents 646f54b + e673056 commit f6e296d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ext/hash/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ PHP_FUNCTION(hash_file)
450450
bool raw_output = 0;
451451
HashTable *args = NULL;
452452

453-
ZEND_PARSE_PARAMETERS_START(2, 3)
453+
ZEND_PARSE_PARAMETERS_START(2, 4)
454454
Z_PARAM_STR(algo)
455455
Z_PARAM_STRING(data, data_len)
456456
Z_PARAM_OPTIONAL

ext/hash/tests/hash_file_basic1.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ echo "sha512: " . hash_file('sha512', $file). "\n";
4242
echo "snefru: " . hash_file('snefru', $file). "\n";
4343
echo "tiger192,3: " . hash_file('tiger192,3', $file). "\n";
4444
echo "whirlpool: " . hash_file('whirlpool', $file). "\n";
45+
echo "murmur3a: " . hash_file('murmur3a', $file). "\n";
46+
echo "murmur3a: " . hash_file('murmur3a', $file, false, ['seed' => 1234]). "\n";
47+
echo "murmur3c: " . hash_file('murmur3c', $file). "\n";
48+
echo "murmur3c: " . hash_file('murmur3c', $file, false, ['seed' => 1234]). "\n";
49+
echo "murmur3f: " . hash_file('murmur3f', $file). "\n";
50+
echo "murmur3f: " . hash_file('murmur3f', $file, false, ['seed' => 1234]). "\n";
4551

4652
echo "adler32(raw): " . bin2hex(hash_file('adler32', $file, TRUE)) . "\n";
4753
echo "md5(raw): " . bin2hex(hash_file('md5', $file, TRUE)). "\n";
@@ -70,6 +76,12 @@ sha512: 1f42adaf938fbf136e381b164bae5f984c7f9fe60c82728bd889c14f187c7d63e81a0305
7076
snefru: d414b2345d3e7fa1a31c044cf334bfc1fec24d89e464411998d579d24663895f
7177
tiger192,3: 7acf4ebea075fac6fc8ea0e2b4af3cfa71b9460e4c53403a
7278
whirlpool: 4248b149e000477269a4a5f1a84d97cfc3d0199b7aaf505913e6f010a6f83276029d11a9ad545374bc710eb59c7d958985023ab886ffa9ec9a23852844c764ec
79+
murmur3a: bc6554c8
80+
murmur3a: 432e4379
81+
murmur3c: 8779de509ffc06fb27bcf5fc861504d6
82+
murmur3c: b43afac65c38a617323020432c170005
83+
murmur3f: 2b84cd546b2f18a9ab6f893194224afd
84+
murmur3f: 6cc7716646664d6a83d68cb6563ac38e
7385
adler32(raw): ff87222e
7486
md5(raw): 704bf818448f5bbb94061332d2c889aa
7587
sha256(raw): a0f5702fa5d3670b80033d668e8732b70550392abb53841355447f8bb0f72245

0 commit comments

Comments
 (0)