以下问题在重新安装 框架、webman/think-cache 后复现。
\support\think\Cache::set($key, 123);
\support\think\Cache::get($key); // 得到字符串 '123'
\support\think\Cache::tag('tag1')->set($key, 123);
\support\think\Cache::tag('tag1')->get($key); // 得到字符串 '123'
// \support\Cache 则不存在该问题。
问题出在如下代码。
think-cache它这个底层驱动是基于字符串的,又有自增接口,为了兼容自增不能使用序列化,就只能这样了。
明白了,大佬牛逼!
强制(int)转换就行了
你这个治标不治本,写了个适配器解决来该问题了。只是来反馈下该问题。