-
Notifications
You must be signed in to change notification settings - Fork 324
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
Return value for get with callback and Memcached::GET_EXTENDED flag in php7 version #248
Comments
I gave a read through #126 and #229 and worked on adding some unit tests for the case of Why in if (with_cas) {
fci->param_count = 3;
} else {
ZVAL_NEW_EMPTY_REF(¶ms[3]); /* expiration */
ZVAL_NULL(Z_REFVAL(params[3]));
fci->param_count = 4;
} I don't get it. In GET_EXTENDED mode, the callback has three arguments, where the $value argument is interpreted as an array with keys @mkoppanen @laruence Could you provide some insight into the design goals on this callback, and whether I should fix/straighten-out this logic by either adding the expirating to the value array, or restoring the fourth argument for expiration from the callback? I strongly prefer to add back the expiration argument and always have the same number of arguments to the callback in GET_EXTENDED mode and regular mode. I think it's bad enough to change the interpretation of the $value argument as mixed vs. array, but also changing the number of expected arguments feels very very awkward to me. It is clearly possible to set the expiration on an item with cas, for example: https://secure.php.net/manual/en/memcached.cas.php |
Also, I notice the following discrepancy:
Yields:
Note how the first array has |
I got a little bit stuck. The memcached binary protocol will return the initial cas value from a set-value operation, but the libmemcahched api does not appear to expose it. |
Using the Memcached::GET_EXTENDED flag, what should be the return value for Memcached::get when a callback is provided and the value is not found in memcached? I would expect a structure like a known value would return, but only the return value of the callback seems to be returned, is this intentional?
The text was updated successfully, but these errors were encountered: