久久久久久久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 中導(dǎo)入類和命名空間:前導(dǎo)反斜杠有什么區(qū)

        Importing classes and namespaces in PHP: What difference does a leading backslash make?(在 PHP 中導(dǎo)入類和命名空間:前導(dǎo)反斜杠有什么區(qū)別?)
          <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 中導(dǎo)入類和命名空間:前導(dǎo)反斜杠有什么區(qū)別?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  這兩者有什么區(qū)別:

                  use Exception;
                  use Exception;
                  

                  或者那些:

                  use FooBar;
                  use FooBar;
                  

                  手冊(cè) 說(shuō):

                  請(qǐng)注意,對(duì)于命名空間名稱(完全限定的命名空間名稱包含命名空間分隔符,例如 FooBar與全局名稱相反不是,例如 FooBar),領(lǐng)先的反斜杠是不必要的,而不是允許,因?yàn)閷?dǎo)入名稱必須完整合格,不處理相對(duì)于當(dāng)前命名空間.

                  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.

                  但我真的不明白這一點(diǎn),因?yàn)樯鲜鏊凶凅w都有效,即絕對(duì)不是不允許"的.

                  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(設(shè)置,當(dāng)有前導(dǎo)反斜杠時(shí))僅用于以下情況的警告:

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

                  這告訴我:具有非復(fù)合名稱 'Exception' 的 use 語(yǔ)句無(wú)效".(雖然對(duì) use Exception 做同樣的事情會(huì)產(chǎn)生同樣的影響,但不會(huì)發(fā)出警告.)

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

                  所以:我錯(cuò)過(guò)了什么嗎?真的有區(qū)別嗎?

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

                  推薦答案

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

                  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.

                  但是,手冊(cè)還有其他問(wèn)題.他們做廣告:

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

                  // importing a global class
                  use ArrayObject;
                  

                  如果導(dǎo)入名稱確實(shí)沒(méi)有相對(duì)于當(dāng)前命名空間進(jìn)行處理,那么 use ArrayObjectuse ArrayObject 必須具有相同的含義.除了全局對(duì)象之外,use ArrayObject 還能引用什么?在實(shí)踐中,引擎會(huì)導(dǎo)入全局的.

                  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.

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

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

                  我認(rèn)為對(duì)于標(biāo)準(zhǔn)應(yīng)該是什么存在混淆.

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

                  回答你的問(wèn)題:沒(méi)有區(qū)別.但是,如果我是引擎開發(fā)者,同時(shí)也是無(wú)前導(dǎo)斜杠標(biāo)準(zhǔn)的信徒,那么我就不需要考慮有人寫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.

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

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

                  相關(guān)文檔推薦

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

                        <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>
                            主站蜘蛛池模板: 亚洲精品电影 | aaaaaa大片免费看最大的 | 一级做a爰片久久毛片免费看 | 亚洲精品乱码久久久久久按摩观 | 国产乱码精品1区2区3区 | 成人在线视频网站 | 免费国产一区 | 国产一区二区不卡 | 黄色网络在线观看 | 久久精品久久综合 | 久久久精品一区 | 久草成人 | 国产精品久久久久久亚洲调教 | 中日字幕大片在线播放 | 久热久热 | 色伊人 | 成人精品一区二区三区四区 | dy天堂| 91在线精品视频 | 国产日产久久高清欧美一区 | 免费一区二区 | 亚洲精品久久久久久国产精华液 | 久久一二 | 亚洲视频在线观看 | 国产一区二区在线播放 | 四虎在线观看 | 国产精品久久久久久238 | 久久亚洲二区 | 涩涩99| 久久精品国产99国产精品 | 亚洲精品久久久 | 国产玖玖 | 九九热精品在线 | 日韩久草 | 欧美综合国产精品久久丁香 | 欧美中文字幕在线 | 在线观看国产wwwa级羞羞视频 | 精品一区二区三区91 | 成人免费视频一区 | www.日韩| 97免费在线观看视频 |