fix usage php_hash_fetch_ops with PHP 8

This commit is contained in:
Pavlo Yatsukhnenko
2020-03-09 14:00:07 +02:00
parent 190c0d34ad
commit 9ee94ca4f6
+7 -1
View File
@@ -551,7 +551,13 @@ ra_find_node(RedisArray *ra, const char *key, int key_len, int *out_pos)
const php_hash_ops *ops;
/* hash */
if (ra->algorithm && (ops = php_hash_fetch_ops(ZSTR_VAL(ra->algorithm), ZSTR_LEN(ra->algorithm))) != NULL) {
if (ra->algorithm && (
#if (PHP_VERSION_ID < 80000)
ops = php_hash_fetch_ops(ZSTR_VAL(ra->algorithm), ZSTR_LEN(ra->algorithm))
#else
ops = php_hash_fetch_ops(ra->algorithm)
#endif
) != NULL) {
void *ctx = emalloc(ops->context_size);
unsigned char *digest = emalloc(ops->digest_size);