such
V2EX  ›  PHP

PHP 魔术方法前加 引用符号

  •  
  •   such · Sep 26, 2018 · 2858 views
    This topic created in 2810 days ago, the information mentioned may be changed or developed.

    看 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 replies    2018-10-08 10:19:04 +08:00
    such
        2
    such  
    OP
       Oct 8, 2018
    @fcten 多谢解惑
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1246 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 17:44 · PVG 01:44 · LAX 10:44 · JFK 13:44
    ♥ Do have faith in what you're doing.