Skip to content
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

expire type not long unexpected #1783

Closed
freeliver opened this issue Jun 9, 2020 · 2 comments
Closed

expire type not long unexpected #1783

freeliver opened this issue Jun 9, 2020 · 2 comments

Comments

@freeliver
Copy link

freeliver commented Jun 9, 2020

Expected behaviour

set(key, value, "3") and set(key, value, ["ex" => "3"]) both success

Actual behaviour

set(key, value, "3") failure but set(key, value, ["ex" => "3"]) success

I'm seeing this behaviour on

  • OS: none
  • Redis: latest
  • PHP: 7.x
  • phpredis:latest

Steps to reproduce, backtrace or example script

$redis = new phpredis()
....
$result = $redis->set(key, value, "3")
//$result is failure

@michael-grunder
Copy link
Member

I'm not sure how relaxed the typing should be here, but I updated the logic to accept a long or a numeric string, while not allowing something like this:

$fp = fopen('/tmp/test.txt', 'a');
$obj_r->set('foo', 'bar', $fp); // PHP's zval_get_long will return the integer file descriptor

@michael-grunder
Copy link
Member

Closing as this has been merged.

Let me know if you're still having issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants