<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### foreach方法 所以,對象其實就是有“生命力”的數組 . **前提是這些屬性是public,如果是私有的或者是受保護的,將無法遍歷**. ~~~ class Person{ public $name; public $age; public $height; public $weight; public function __construct($name, $age, $height, $weight) { $this->name = $name; $this->age = $age; $this->height = $height; $this->weight = $weight; } } $p = new Person('jack',20,150,176); foreach($p as $key => $value){ echo $key.'-->'.$value; } ~~~ ~~~ name-->jack age-->20 height-->150 weight-->176 ~~~ ### 定義方法遍歷非public屬性 ~~~ class Person{ private $name; private $age; private $height; private $weight; public function __construct($name, $age, $height, $weight) { $this->name = $name; $this->age = $age; $this->height = $height; $this->weight = $weight; } public function myForeach() { foreach($this as $key => $value){ echo $key . '-->' . $value; } } } $p = new Person('jack', 20, 150, 176); $p->myForeach(); ~~~ ~~~ name-->jack age-->20 height-->150 weight-->176 ~~~ ### 對象自定義遍歷
                  <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>

                              哎呀哎呀视频在线观看