nicolasff/phpredis — Issue #113: zAdd does not set the correct score for values 1000 & above
Author: DerNiro
Created: 2011-12-26 07:48:01+00:00
State: open

Hi,
I've been using your API for Redis for a few days now and it's the best by far. It leaves a tiny footprint and has all the functions I need. Keep up the great work.

Now to the bug I came across. When creating a Sorted Set, the score is not properly set when using zAdd. If the score is 1000 or above, the score changes to the first digit only.

PHP Script:
$redis->zAdd('anothertest',1000,'work');

Redis-Cli Monitor:
1324885452.287708 "ZADD" "anothertest" "1" "work"

I've tested it with smaller values (including doubles) and it's working just fine. Casting the value as a string has the same effect. The score range I was trying to set was the microtime. Redis seems to be able to work with values that high, so I'm pretty sure there's a minor bug somewhere in the API.

If you need more info, let me know.

Testing Machine:
64bit Centos 6.0