Skip to content

Commit

Permalink
fix usage php_hash_fetch_ops with PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
yatsukhnenko committed Mar 9, 2020
1 parent 190c0d3 commit 9ee94ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion redis_array_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9ee94ca

Please sign in to comment.