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

PHP 魔术方法前加 引用符号

  •  
  •   such · 2018-09-26 10:09:42 +08:00 · 1968 次点击
    这是一个创建于 2029 天前的主题,其中的信息可能已经有所发展或是发生改变。

    看 Laravel 源码,参考了一下它的 View 组件,发现这个写法 &__get,求问是什么意思呢

        /**
         * Get a piece of data from the view.
         *
         * @param  string  $key
         * @return mixed
         */
        public function &__get($key)
        {
            return $this->data[$key];
        }
    
    2 条回复    2018-10-08 10:19:04 +08:00
    fcten
        1
    fcten  
       2018-09-26 10:13:24 +08:00
    such
        2
    such  
    OP
       2018-10-08 10:19:04 +08:00
    @fcten 多谢解惑
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2770 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 15:38 · PVG 23:38 · LAX 08:38 · JFK 11:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.