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

Skip to content

Commit 85dc883

Browse files
yatsukhnenkomichael-grunder
authored andcommitted
Fix RedisArray::__construct bug
1 parent a26b14d commit 85dc883

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

redis_array.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,14 @@ PHP_METHOD(RedisArray, __construct)
240240
* Note: WRONG_PARAM_COUNT seems wrong but this is what we have been doing
241241
* for ages so we can't really change it until the next major version.
242242
*/
243-
if (Z_TYPE_P(z0) != IS_ARRAY && Z_TYPE_P(z0) != IS_STRING)
243+
if (Z_TYPE_P(z0) != IS_ARRAY && Z_TYPE_P(z0) != IS_STRING) {
244+
#if PHP_VERSION_ID < 80000
244245
WRONG_PARAM_COUNT;
246+
#else
247+
zend_argument_type_error(1, "must be of type string|array, %s given", zend_zval_type_name(z0));
248+
RETURN_THROWS();
249+
#endif
250+
}
245251

246252
/* If it's a string we want to load the array from ini information */
247253
if (Z_TYPE_P(z0) == IS_STRING) {

0 commit comments

Comments
 (0)