Easy to learn the hard fine PHP

Source: Internet
Author: User
Tags apc

PHP is an easy and proficient language to get started.

First, as everyone knows, PHP is also a compiled scripting language, unlike other precompiled languages, which are not compiled into intermediate code and then published. Instead, the compilation is required for each run.

For this, there are some opcode cacche, such as the Open source APC, EACC. There are commercial Zend o+ and so on.

So why does PHP not separate the compilation/execution?

PHP is a compiled scripting language, but it compiles very fast, its compilation does not do any semantic optimization, is simply faithful to the code you write to the corresponding opcodes. Other languages because of the compiler to do a lot of optimization work, will cause the compilation is heavier, but also to some extent requires them to separate.

Therefore, theoretically, by the implementation of the separation, to achieve the source code encryption, is not much effect, because it is easy to reverse.

In addition, the direct separation of the compilation, and will not bring particularly large benefits, but will reduce the efficiency of debugging deployment (think, modify, compile, publish, see the effect), and APC and other opcode cache tools, is already very mature.

Here, please pay attention to this sentence: "Its compilation does not do any semantic optimization" ....

That's why I say PHP is more demanding for programmers than other compiled languages, and PHP won't help you with optimizations when compiling.
PHP programmers, need to seriously think about how your code will be executed, how you write code, the ultimate execution efficiency is highest. Rather than other languages, programmers can give a part of the optimization work to the compiler.


This article comes from:PHP training , Open Source It education , open source it education and training

Easy to learn the hard fine 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.