Description
Hi, when work with this extension, I found that SETBIT & GETBIT , the maximum value of the parameter 'offset' is 2147483647(system environment is x64), the method would return 'false' if offset was greater than this value.
As the Official of Redis said:'The offset argument is required to be greater than or equal to 0, and smaller than 232 (this limits bitmaps to 512MB).'
So, I downloaded the source code of phpredis, and found that line 1771 in 'redis.c'
cmd_len = redis_cmd_format_static(&cmd, "SETBIT", "sdd", key, key_len, (int)offset, (int)val);
the 'offset' was explicit converse to integer, and the 'format' was sent by 'sdd', but actually, the variable 'offset' was declared to 'long' lines before.
I commented the explicit conversion and change the 'format' into 'sld', the problem solved.
Could you please tell me, was this a bug? or something you did deliberately?