-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Variable number of arguments to methods #14
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
Hi Chris, Some of the methods that take a variable number of arguments already do take an array if provided.
It adds a certain complexity to the code, so I won't add any more if there's no support for variadic commands in Redis. I'm aware of some recent changes in methods such as I'm leaving this ticket open until proper support for those new changes have been added. |
Ah k, thanks. |
Do sRem and sAdd take an array? Is it less efficient to use call_user_func_array? I ask because my Zend_Cache backend which uses phpredis seems to get considerably slower at some point when there is a large number of keys and I'm suspecting that calling these methods with call_user_func_array and a huge number of parameters could be the issue. -Thanks! |
@colinmollenhour you can use an array, or a variable number of arguments, I'm not sure it would make that much of a difference. Please try the latest version though, I pushed a fix a few days ago that should speed up these commands when dealing with very large numbers of keys. |
Some methods such as
sUnion()
take a variable number of arguments. It would be awesome to have a variant of each method which takes an array of arguments - i.e. something likesprintf
vs.vsprintf
.Currently we have to
call_user_func_array
or do a switch oncount($args)
if we don't know the number of arguments in advance.The text was updated successfully, but these errors were encountered: