What is the difference between a comma and a dot number for PHP echo? Which is faster?

Source: Internet
Author: User
First the great God article 54chen

The echo string is referred to as , better than the . connection. The reason is not to say, first look at the following two sentences

 
  
   

结果是什么?
1+5=6?
1+5=6?
——————
6?
2?
——————
6.6?
6.6?
——————
我只能说echo '5+1=' . 1+5;的结果是10,所以结果是62.

php echo manual

 

至于为啥快,可以简单理解,用.是先拼接在echo,虽然逗号个数代表echo的调用次数(可以这么理解暂时)。
但是拼接的速度要小于echo的速度。
如果深入理解,VLD如。是@tywei大神的图

上面比下面多了个CONCAT,下面比上面多了个echo。
如果想知道更多详细信息,点击查看这个重磅炸弹

以上就介绍了关于php echo用逗号和用点号连接的区别?哪个更快?,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.