<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之旅 廣告
                # 9.3 PHP中的資源類型 zval通過引用計數來節省內存的,這個我們都知道了,但你可能不知道的是,某個zval對應的{資源}在實現時也使用了引用計數這種概念,也就是有了兩種引用計數! {資源}對應的zval的類型是IS_RESOURCE,它并不保存最終的數據,而只保存一個數字,即EG(regular_list)中的數字索引。 當{資源}被創建時,比如我們調用sample_fopen()函數: ````php $a = sample_fopen('notes.txt', 'r'); //此時:var->refcount__gc = 1, rsrc->refcount = 1 $b = $a; //此時:var->refcount__gc = 2, rsrc->refcount = 1 unset($b); //此時:var->refcount__gc = 1, rsrc->refcount = 1 /* 下面來個復雜的! */ $b = $a; $c = &$a; //此時: /* bvar->refcount = 1, bvar->is_ref = 0 acvar->refcount = 2, acvar->is_ref = 1 rsrc->refcount = 2 */ ```` 現在,如果我們unset($b),內核只會把rsrc->refcount的值減1。只有當rsrc->refcount的值為0時,我們預設的dtor釋放函數才會被激活并調用。 ## links * 9.2 [Persistent Resources](<9.2.md>) * 9.4 [第九章小結](<9.4.md>)
                  <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>

                              哎呀哎呀视频在线观看