V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
doyouhaobaby
V2EX  ›  PHP

PHP RFC: Preloading 预加载静态成员和变量它们的值不会重新返回请求边界

  •  
  •   doyouhaobaby · 2019-05-17 11:16:08 +08:00 · 2906 次点击
    这是一个创建于 1777 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://wiki.php.net/rfc/preload

    Static members and static variables

    To avoid misunderstanding, it is clear stated that preloading doesn't change the behavior of static class members and static variables. Their values are not going to relive request boundary.

    它们的值不会重新返回请求边界。
    是不是可以意味着将数据存在静态成员上面,而每次请求可用。
    2 条回复    2019-05-17 13:46:41 +08:00
    funnuy
        1
    funnuy  
       2019-05-17 13:43:17 +08:00   ❤️ 1
    > To avoid misunderstanding, it is clear stated that preloading doesn't change the behavior of static class members and static variables.

    不会改变静态成员和变量的语义。

    > Their values are not going to relive request boundary.

    它们还是活不过请求边界,就是每次请求都初始化。
    doyouhaobaby
        2
    doyouhaobaby  
    OP
       2019-05-17 13:46:41 +08:00
    @funnuy 想反了,要是留一个开关就好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   960 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:52 · PVG 05:52 · LAX 14:52 · JFK 17:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.