diff --git a/library.c b/library.c index e9801ee..d747d84 100644 --- a/library.c +++ b/library.c @@ -2686,14 +2686,22 @@ fail: PHP_REDIS_API int redis_deserialize_vgetattr_reply(zval *zret, const char *str, size_t len) { #ifdef HAVE_REDIS_JSON - if (php_json_decode(zret, str, len, 1, PHP_JSON_PARSER_DEFAULT_DEPTH) - == FAILURE) + #if PHP_VERSION_ID < 80000 + #define PHP_JSON_IN(s) ((char*)s) + #else + #define PHP_JSON_IN(s) (s) + #endif + + if (php_json_decode(zret, PHP_JSON_IN(str), len, 1, + PHP_JSON_PARSER_DEFAULT_DEPTH) == FAILURE) { php_error_docref(NULL, E_WARNING, "Failed to deserialize attributes"); return FAILURE; } return SUCCESS; + + #undef PHP_JSON_IN #else php_error_docref(NULL, E_WARNING, "PhpRedis is not compiled with JSON support"); diff --git a/redis_commands.c b/redis_commands.c index 329bd0c..d51371b 100644 --- a/redis_commands.c +++ b/redis_commands.c @@ -7043,8 +7043,8 @@ int redis_vlinks_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx) { - zend_bool withscores = false; smart_string cmdstr = {0}; + zend_bool withscores = 0; zend_string *key; zval *member;