<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之旅 廣告
                ## 關于命名空間 ### 1. 命名空間的介紹 http://php.net/manual/zh/language.namespaces.rationale.php 1. 當工程越來越大,PHP文件會越來越多,產生的沖突也會越來越多。 2. 項目越來越大,功能越來越復雜,類也越來越多,如何管理這些類,使用到了「包」的概念,有層次的區分每一個類,使代碼越來越規范。 PHP 5.3以后支持命名空間。 ### 2. 命名空間的定義 *D:\wamp\www\demo\oop\test1.php* ~~~ <?php // namespace Test1; function test() { echo __FILE__; } ~~~ *D:\wamp\www\demo\oop\test2.php* ~~~ <?php // namespace Test2; function test() { echo __FILE__; } ~~~ *D:\wamp\www\demo\oop\test.php* ~~~ <?php include './test1.php'; include './test2.php'; ~~~ *http://127.0.0.1/demo/oop/test.php* ![](https://box.kancloud.cn/c805010b67d211dc52985a0c24177c68_1015x651.png) 只有開啟了 `namespace` 才能避免函數名重復的沖突出現。 PHP 命名空間提供了一種將相關的類、函數和常量組合到一起的途徑。 ### 3. 命名空間的使用 [http://php.net/manual/zh/language.namespaces.basics.php](http://php.net/manual/zh/language.namespaces.basics.php) *D:\wamp\www\demo\oop\test.php* ~~~ <?php include './test1.php'; include './test2.php'; Test1\test(); Test2\test(); ~~~ 結果輸出: ~~~ D:\wamp\www\demo\oop\test1.phpD:\wamp\www\demo\oop\test2.php ~~~
                  <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>

                              哎呀哎呀视频在线观看