You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"message": "Object of class Redis could not be converted to int",
"exception": "ErrorException",
"file": "/src/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php",
"line": 100,
}
This means that after using Redis::multi(), the return value of the Redis object is a However, in PhpRedisConnection#setnx, there is an attempt to convert it to an int The reason for this is because they are doing it.
The phpredis documentation also states.
multi() returns the Redis instance and enters multi-mode. Once in multi-mode, all subsequent method calls return the same object until exec() is called.
Based on the above, I thought it was a bug and forked the laravel/framework repository.
The branch is 6.x
And I was able to convert a Redis object to an int.
I don't understand why there is such a difference between the two, so I was wondering if you could help me out.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
environment
description
When I try to run the following code in my app, it raises an exception with setnx.
We also have a similar problem with
hsetnx
.code
exception
This means that after using
Redis::multi()
, the return value of theRedis
object is a However, inPhpRedisConnection#setnx
, there is an attempt to convert it to an int The reason for this is because they are doing it.The phpredis documentation also states.
via. https://github.com/phpredis/phpredis/blob/a0c53e0b30e0c6af15cc137415e7d65f6d1867f7/README.markdown#multi-exec-discard
Based on the above, I thought it was a bug and forked the laravel/framework repository.
The branch is 6.x
And I was able to convert a Redis object to an int.
I don't understand why there is such a difference between the two, so I was wondering if you could help me out.
code
output in the forked laravel/framework
output in my apps
Beta Was this translation helpful? Give feedback.
All reactions