-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Method pexpire() doesnot exists #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fixed by #175. |
Output
|
Man this is weird, When I run your script I get this:
|
My mistake, sorry :-( |
Hmm .. It seems to me that the problem is that I am using 32 bit system, and you work on a 64 bit operating system. Error was not fixed. $r = new Redis();
$r->connect('127.0.0.1');
$r->set( 'ptest', 'test' );
$r->persist('ptest');
var_dump( $r->pexpireAt( 'ptest', 1555555555005) );
var_dump( $r->ttl( 'ptest' ) );
var_dump( $r->pttl( 'ptest' ) );
var_dump( $r->get('ptest') ); output
redis MONITOR
uname -a |
Thanks @ukko, reopened. |
Nicolas, What about just treating it like a string, and doing some very simple check that all of the characters are 0-9? This would mean we would need to return a string as well, meaning the client would have to convert the return value. |
Indeed that would work, but at the cost of dumbing down 64-bit clients... I checked on a 32-bit VM and PHP converts them to float. I guess that could be an acceptable alternative for 32-bit clients. What do you think? |
I'm sorry, what types are converted to float in 32 bit? This could work if the float is wide enough. It has been forever since I've coded for 32 bit. :) The other solution, is to #ifdef 32 bit vs. 64 bit, but that seems brutal. |
Timeouts in milliseconds overflow longs on 32-bit architectures. This fix replaces the integer return with a float on 32-bit. Ref: GitHub issue #174.
@michael-grunder refresh the page, I did put an #ifdef :) |
@ukko Could you please try it out? I've change methods like |
Dont work :-( |
Tested on 32-bits, addresses GitHub issue #174.
@ukko sorry about that, I made a new fix and tested it on a 32-bit VM with success. It returns a string instead of a long, I'm afraid there's no way around it. |
Thank you, Nicolas and Michael. Its work! :-)
|
output
The text was updated successfully, but these errors were encountered: