Git Product home page Git Product logo

Comments (7)

Neeke avatar Neeke commented on May 30, 2024

@danvinhe 那如果业务本身需要,存的value为null呢?

from yac.

danvinhe avatar danvinhe commented on May 30, 2024

@Neeke 是的,这个比较惆怅。我们的解决方案是存以前把$value,变成array($value)

from yac.

liufang avatar liufang commented on May 30, 2024

@Neeke null本身就是未知, 你自己都不知道, 你还设置啥. key不存在, 返回null应该是正确的.

from yac.

geekli avatar geekli commented on May 30, 2024

我觉得这种情况应该就不需要使用这种方式缓存了
假如真想缓存 做变换处理 存储一个特殊字符(对了 难道这种不是只能做字符串存储吗?)

from yac.

captainQW avatar captainQW commented on May 30, 2024

有在线上跑的么?

from yac.

yyxx9988 avatar yyxx9988 commented on May 30, 2024
1. key不存在时,返回null
2. set时,value不允许是null

@laruence 我也觉得这样比较好,一般PHP框架数据库ORM返回值的时候,如果不存在就返回null

from yac.

gouchaoer avatar gouchaoer commented on May 30, 2024

返回false没有问题,比如yii2的缓存接口就是返回false:http://www.yiichina.com/doc/guide/2.0/caching-data

from yac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.