Commit a96f6ff2c7a for php.net
commit a96f6ff2c7a8452b78c1267f9e897ab6e2c5e849
Author: Weilin Du <weilindu@php.net>
Date: Fri Jul 31 00:02:51 2026 +0800
Fix GH-22935: Make php_hash.h includable from C++ code (#22940)
diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h
index b77557c5bf7..bf99ce185b4 100644
--- a/ext/hash/php_hash.h
+++ b/ext/hash/php_hash.h
@@ -158,7 +158,7 @@ static inline void *php_hash_alloc_context(const php_hash_ops *ops) {
/* Zero out context memory so serialization doesn't expose internals */
if (ops->context_align > 0) {
size_t align = ops->context_align;
- char *base = ecalloc(1, ops->context_size + align);
+ char *base = (char *) ecalloc(1, ops->context_size + align);
size_t offset = align - ((uintptr_t)base & (align - 1));
char *ptr = base + offset;
ptr[-1] = (char)offset;