Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ee94ca

Browse files
committed
fix usage php_hash_fetch_ops with PHP 8
1 parent 190c0d3 commit 9ee94ca

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

redis_array_impl.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,13 @@ ra_find_node(RedisArray *ra, const char *key, int key_len, int *out_pos)
551551
const php_hash_ops *ops;
552552

553553
/* hash */
554-
if (ra->algorithm && (ops = php_hash_fetch_ops(ZSTR_VAL(ra->algorithm), ZSTR_LEN(ra->algorithm))) != NULL) {
554+
if (ra->algorithm && (
555+
#if (PHP_VERSION_ID < 80000)
556+
ops = php_hash_fetch_ops(ZSTR_VAL(ra->algorithm), ZSTR_LEN(ra->algorithm))
557+
#else
558+
ops = php_hash_fetch_ops(ra->algorithm)
559+
#endif
560+
) != NULL) {
555561
void *ctx = emalloc(ops->context_size);
556562
unsigned char *digest = emalloc(ops->digest_size);
557563

0 commit comments

Comments
 (0)