久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='BONLg'><style id='BONLg'><dir id='BONLg'><q id='BONLg'></q></dir></style></legend>

      <bdo id='BONLg'></bdo><ul id='BONLg'></ul>

    <tfoot id='BONLg'></tfoot>

    1. <i id='BONLg'><tr id='BONLg'><dt id='BONLg'><q id='BONLg'><span id='BONLg'><b id='BONLg'><form id='BONLg'><ins id='BONLg'></ins><ul id='BONLg'></ul><sub id='BONLg'></sub></form><legend id='BONLg'></legend><bdo id='BONLg'><pre id='BONLg'><center id='BONLg'></center></pre></bdo></b><th id='BONLg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BONLg'><tfoot id='BONLg'></tfoot><dl id='BONLg'><fieldset id='BONLg'></fieldset></dl></div>

      <small id='BONLg'></small><noframes id='BONLg'>

        在 PHP 中導入類和命名空間:前導反斜杠有什么區

        Importing classes and namespaces in PHP: What difference does a leading backslash make?(在 PHP 中導入類和命名空間:前導反斜杠有什么區別?)
          <bdo id='24Ahd'></bdo><ul id='24Ahd'></ul>

          1. <tfoot id='24Ahd'></tfoot>

            <small id='24Ahd'></small><noframes id='24Ahd'>

              <legend id='24Ahd'><style id='24Ahd'><dir id='24Ahd'><q id='24Ahd'></q></dir></style></legend>
                <i id='24Ahd'><tr id='24Ahd'><dt id='24Ahd'><q id='24Ahd'><span id='24Ahd'><b id='24Ahd'><form id='24Ahd'><ins id='24Ahd'></ins><ul id='24Ahd'></ul><sub id='24Ahd'></sub></form><legend id='24Ahd'></legend><bdo id='24Ahd'><pre id='24Ahd'><center id='24Ahd'></center></pre></bdo></b><th id='24Ahd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='24Ahd'><tfoot id='24Ahd'></tfoot><dl id='24Ahd'><fieldset id='24Ahd'></fieldset></dl></div>
                    <tbody id='24Ahd'></tbody>
                  本文介紹了在 PHP 中導入類和命名空間:前導反斜杠有什么區別?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這兩者有什么區別:

                  use Exception;
                  use Exception;
                  

                  或者那些:

                  use FooBar;
                  use FooBar;
                  

                  手冊 說:

                  請注意,對于命名空間名稱(完全限定的命名空間名稱包含命名空間分隔符,例如 FooBar與全局名稱相反不是,例如 FooBar),領先的反斜杠是不必要的,而不是允許,因為導入名稱必須完整合格,不處理相對于當前命名空間.

                  Note that for namespaced names (fully qualified namespace names containing namespace separator, such as FooBar as opposed to global names that do not, such as FooBar), the leading backslash is unnecessary and not allowed, as import names must be fully qualified, and are not processed relative to the current namespace.

                  但我真的不明白這一點,因為上述所有變體都有效,即絕對不是不允許"的.

                  But I don't really understand this, as all of the above variants work, i.e. it definitely is not "not allowed".

                  查看 zend_do_use 表明,is_global(設置,當有前導反斜杠時)僅用于以下情況的警告:

                  A look into zend_do_use showed, that is_global (set, when there is a leading backslash) is only used for a warning in the following case:

                  namespace {
                      use Exception;
                  }
                  

                  這告訴我:具有非復合名稱 'Exception' 的 use 語句無效".(雖然對 use Exception 做同樣的事情會產生同樣的影響,但不會發出警告.)

                  Which tells me: "The use statement with non-compound name 'Exception' has no effect". (Though doing the same with use Exception would have just as little effect, but does not throw a warning.)

                  所以:我錯過了什么嗎?真的有區別嗎?

                  So: Am I missing something? Is there actually some difference?

                  推薦答案

                  手冊將反斜杠指定為不必要,這自然意味著如果您仍然使用它,則其含義是等效的.但是,正如您所指出的,手冊上說這是不允許的,這是錯誤的.

                  The manual specifies the backslash as unnecessary, which naturally means that if you still use it that the meaning is equivalent. However, as you have pointed out, the manual says that it is supposedly not allowed, which is false.

                  但是,手冊還有其他問題.他們做廣告:

                  However, there is something else troubling with the manual. They advertise this:

                  // importing a global class
                  use ArrayObject;
                  

                  如果導入名稱確實沒有相對于當前命名空間進行處理,那么 use ArrayObjectuse ArrayObject 必須具有相同的含義.除了全局對象之外,use ArrayObject 還能引用什么?在實踐中,引擎會導入全局的.

                  If it is true that import names are not processed relative to the current namespace, then use ArrayObject and use ArrayObject must have the same meaning. What else could use ArrayObject refer to other than the global one? In practice, the engine will import the global one.

                  此外,還有這樣的錯誤:http://bugs.php.net/bug.php?id=49143

                  Also, with bugs such as this: http://bugs.php.net/bug.php?id=49143

                  我認為對于標準應該是什么存在混淆.

                  I believe there is confusion over what the standard is supposed to be.

                  回答你的問題:沒有區別.但是,如果我是引擎開發者,同時也是無前導斜杠標準的信徒,那么我就不需要考慮有人寫use Exception; 的情況.我相信這很可能是這種情況.

                  To answer your question: there is no difference. However, if I was the engine developer who was also a believer of the no-leading-slash standard, then I wouldn't need to consider a case where someone wrote use Exception;. I believe this was likely the case.

                  這篇關于在 PHP 中導入類和命名空間:前導反斜杠有什么區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                        <tbody id='jDQNu'></tbody>

                        1. <legend id='jDQNu'><style id='jDQNu'><dir id='jDQNu'><q id='jDQNu'></q></dir></style></legend>
                          <i id='jDQNu'><tr id='jDQNu'><dt id='jDQNu'><q id='jDQNu'><span id='jDQNu'><b id='jDQNu'><form id='jDQNu'><ins id='jDQNu'></ins><ul id='jDQNu'></ul><sub id='jDQNu'></sub></form><legend id='jDQNu'></legend><bdo id='jDQNu'><pre id='jDQNu'><center id='jDQNu'></center></pre></bdo></b><th id='jDQNu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jDQNu'><tfoot id='jDQNu'></tfoot><dl id='jDQNu'><fieldset id='jDQNu'></fieldset></dl></div>

                          <small id='jDQNu'></small><noframes id='jDQNu'>

                          <tfoot id='jDQNu'></tfoot>

                          • <bdo id='jDQNu'></bdo><ul id='jDQNu'></ul>
                            主站蜘蛛池模板: 黄在线免费观看 | 国产欧美一区二区三区视频在线观看 | 久久成人综合 | 日韩黄色录像 | 日韩一区精品 | av在线天堂 | 久久免费影院 | 亚州成人 | 午夜av片| 91免费网站入口 | 国产一级一片免费播放放a 免费国产视频 | 超碰91在线 | 婷婷伊人网 | 欧美日日日 | 久久久天堂国产精品女人 | 亚洲男人av | 亚洲免费视频网站 | 毛片久久 | 欧美日韩亚洲天堂 | 国产在线一区二区三区 | 色综合视频在线观看 | 免费在线小视频 | 99久久久精品 | 免费黄色av网站 | 国产理论在线观看 | 超碰成人在线观看 | 在线播放亚洲 | 特黄老太婆aa毛毛片 | 日韩专区在线观看 | 免费a网站 | 久久精品国产视频 | a免费视频 | 国产福利在线播放 | 懂色av| 成人毛片在线观看 | 91一区| 国产福利视频 | 黄色大毛片 | 成人不卡| 97在线免费视频 | 免费网站观看www在线观看 |