<legend id='B6vyR'><style id='B6vyR'><dir id='B6vyR'><q id='B6vyR'></q></dir></style></legend>
    <bdo id='B6vyR'></bdo><ul id='B6vyR'></ul>
<i id='B6vyR'><tr id='B6vyR'><dt id='B6vyR'><q id='B6vyR'><span id='B6vyR'><b id='B6vyR'><form id='B6vyR'><ins id='B6vyR'></ins><ul id='B6vyR'></ul><sub id='B6vyR'></sub></form><legend id='B6vyR'></legend><bdo id='B6vyR'><pre id='B6vyR'><center id='B6vyR'></center></pre></bdo></b><th id='B6vyR'></th></span></q></dt></tr></i><div id='B6vyR'><tfoot id='B6vyR'></tfoot><dl id='B6vyR'><fieldset id='B6vyR'></fieldset></dl></div>

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

  • <tfoot id='B6vyR'></tfoot>

        为什么 PHP 中的函数和方法不区分大小写?

        Why are functions and methods in PHP case-insensitive?(为什么 PHP 中的函数和方法不区分大小写?)
        <legend id='KdhdP'><style id='KdhdP'><dir id='KdhdP'><q id='KdhdP'></q></dir></style></legend>
          <bdo id='KdhdP'></bdo><ul id='KdhdP'></ul>

          <i id='KdhdP'><tr id='KdhdP'><dt id='KdhdP'><q id='KdhdP'><span id='KdhdP'><b id='KdhdP'><form id='KdhdP'><ins id='KdhdP'></ins><ul id='KdhdP'></ul><sub id='KdhdP'></sub></form><legend id='KdhdP'></legend><bdo id='KdhdP'><pre id='KdhdP'><center id='KdhdP'></center></pre></bdo></b><th id='KdhdP'></th></span></q></dt></tr></i><div id='KdhdP'><tfoot id='KdhdP'></tfoot><dl id='KdhdP'><fieldset id='KdhdP'></fieldset></dl></div>

                <tbody id='KdhdP'></tbody>

                • <small id='KdhdP'></small><noframes id='KdhdP'>

                  <tfoot id='KdhdP'></tfoot>
                • 本文介绍了为什么 PHP 中的函数和方法不区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  PHP 中的函数和方法不区分大小写,如下例所示.

                  Functions and methods in PHP are case-insensitive as illustrated in the following example.

                  function ag()
                  {
                      echo '2';
                  }
                  
                  Ag();
                  class test {
                      function clMe()
                      {
                          echo 'hi';
                      }
                  }
                  
                  $instance = new test;
                  $instance->clme();
                  

                  但这不是变量的情况.理由是什么?

                  But that's the not case with variables. What's the rationale?

                  推荐答案

                  让我引用 采访——PHP 的创造者 Rasmus Lerdorf

                  PHP 的第一个版本是一组简单的工具,我为我的网站和几个项目组合了这些工具.一个工具对 mSQL 数据库进行了一些奇特的命中记录,另一个充当表单数据解释器.在我厌烦之前,我最终得到了大约 30 个用 C 编写的不同的小 CGI 程序,并将它们组合成一个 C 库.然后我编写了一个非常简单的解析器,它会从 HTML 文件中挑选标签,并将它们替换为 C 库中相应函数的输出.

                  The first version of PHP was a simple set of tools that I put together for my Website and for a couple of projects. One tool did some fancy hit logging to an mSQL database, another acted as a form data interpreter. I ended up with about 30 different little CGI programs written in C before I got sick of it, and combined all of them into a single C library. I then wrote a very simple parser that would pick tags out of HTML files and replace them with the output of the corresponding functions in the C library.

                  这个简单的解析器慢慢地成长为包含条件标签,然后是循环标签、函数等.我从来不认为我在写一种脚本语言.我只是向宏替换解析器添加了一点功能.我仍在用 C 编写所有真正的业务逻辑.

                  The simple parser slowly grew to include conditional tags, then loop tags, functions, etc. At no point did I think I was writing a scripting language. I was simply adding a little bit of functionality to the macro replacement parser. I was still writing all my real business logic in C.

                  我在某处读到过,因为引入的所有函数本质上都像 HTML 文档中的标签,并且由于 HTML 标签不区分大小写,所以他在 PHP 中选择了不区分大小写的函数名称.此功能后来保留在语言中.

                  I have read somewhere that since all the functions introduced essentially felt like tags in an HTML document and since HTML tags were case insensitive, he chose function names in PHP to be case insensitive. Later on this feature remained on in the language.

                  这篇关于为什么 PHP 中的函数和方法不区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How do I pass parameters into a PHP script through a webpage?(如何通过网页将参数传递给 PHP 脚本?)
                  PHP - include a php file and also send query parameters(PHP - 包含一个 php 文件并发送查询参数)
                  Where can I read about conditionals done with quot;?quot; and quot;:quot; (colon)?(我在哪里可以阅读有关使用“?完成的条件的信息?和“:(冒号)?)
                  Accessing arrays whitout quoting the key(在不引用键的情况下访问数组)
                  What is the name for the quot;lt;lt;lt;quot; operator?(“lt;lt;lt;的名字是什么?操作员?)
                  default as first option in switch statement?(默认为 switch 语句中的第一个选项?)
                • <small id='1sBpJ'></small><noframes id='1sBpJ'>

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