<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 功能強大 支持多語言、二開方便! 廣告
                **一.static類型作用** PHP 8.0允許static作為類方法的返回類型. &emsp; **二.static語法** ``` class Foo { public static function getInstance(): static { return new static(); } } ``` &emsp; **三.僅返回類型** static返回類型僅允許作為返回類型。不允許將其作為屬性類型或參數類型. &emsp; **四.不允許在類外使用** 只有類方法可以聲明static返回類型。標準函數或閉包不允許聲明static返回類型. &emsp; **五.實用代碼實例** 1.對象鏈設計 ``` class Person{ public function say(){ return $this; } public function show(){ return $this; } public function look(){ echo 'say->show->look->echo'; } } $obj=new Person; $obj->say()->show()->look(); ``` 2.類鏈設計 ``` class Person{ public static function say():static{ return new static(); } public static function show():static{ return new static(); } public static function look(){ echo 'Person::say()::show()::look() echo'; } } Person::say()::show()::look(); ``` 3.類輸出靜態方法中的類常量 ``` class Person{ const HOST='localhost'; public static function say(){ return self::HOST; } } echo Person::say(); ``` &emsp; **配套的PHP8新特性詳解視頻教程,請查看以下專輯** 鏈接:[https://www.ixigua.com/6937490165329822219](https://www.ixigua.com/6937490165329822219)
                  <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>

                              哎呀哎呀视频在线观看