From 9ee94ca4f6212d1c6a7e8378c17df97d691068f7 Mon Sep 17 00:00:00 2001 From: Pavlo Yatsukhnenko Date: Mon, 9 Mar 2020 14:00:07 +0200 Subject: fix usage php_hash_fetch_ops with PHP 8 --- redis_array_impl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'redis_array_impl.c') diff --git a/redis_array_impl.c b/redis_array_impl.c index 646b08a2..c3cfd2b6 100644 --- a/redis_array_impl.c +++ b/redis_array_impl.c @@ -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); -- cgit v1.2.3