<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # new self()和new static()的區別 1. new self()和new static()的區別只有在繼承中才能體現出來,如果沒有任何繼承,那么這兩者是沒有區別的。 2. 在繼承中,new self()返回的實例是萬年不變的,無論誰去調用,都返回同一個類的實例,而new static()則是由調用者決定的。 實例1:無繼承 ~~~ class Father { public function useSelf() { return new self(); } public function useStatic() { return new static(); } } $f = new Father(); echo get_class($f->useSelf())."\n";// 輸出 Father echo get_class($f->useStatic())."\n";// 輸出 Father ~~~ 輸出結果: Father Father 實例2:繼承(Father類為實例1的Father類) ~~~ class Sun1 extends Father { } class Sun2 extends Father { } $sun1 = new Sun1(); $sun2 = new Sun2(); echo get_class($sun1->useSelf())."\n"; // 輸出 Father echo get_class($sun1->useStatic())."\n"; // 輸出 Sun1 echo get_class($sun2->useSelf())."\n"; // 輸出 Father echo get_class($sun2->useStatic())."\n"; // 輸出 Sun2 ~~~ 輸出結果: Father Sun1 Father Sun2 資料來源: http://www.cnblogs.com/shizqiang/p/6277091.html
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看