PHP first met,

Source: Internet
Author: User

PHP first met,

1. What is PHP?

PHP: Hypertext Preprocessor is an open source scripting language running on the server.

So what is a scripting language? The opposite of a scripting language is not a high-level programming language. It is also a programming language. The difference between a scripting language and a non-scripting language can be seen as "parsing language" and "Compiling language: before running, the compiled language links the code to executable machine code for the specific platform. The parsed language does not compile and execute the code line by line until it is running.

2. PHP language structure:

PHP is divided into four layers from bottom to bottom:

① Zend engine: compiles PHP code into opcode (operating code) and executes them. Note that this is not a machine code. The machine code is CPU-oriented. The opcode here is for the Zend engine. In terms of functions, Zend engine can be used as a virtual machine in java.

② Extensions: Class Libraries and function libraries, which define various data structures and functions.

③ SAPI: Server Application Programming Interface, which is obviously an intermediate layer used to reduce the coupling between the underlying layer and the upper layer. Simply put, the Extensions layer service is called to encapsulate more powerful services for upper-layer applications to call.

④ Upper-layer applications: PHP projects written by users themselves.

 

3. What are the advantages and disadvantages of PHP?

Advantages:

① Simple: The syntax is simple, and PHP generally does not perform complex logic or operations.

② High development efficiency: many common functions in development have been encapsulated. Some people say that the write function is to find "what is the function used for XXX" on the Internet.

③ Free, open-source, and cross-platform because it is a parsing language.

Disadvantages:

① Low running efficiency: Because PHP is a parsing language, the "Compilation" step will be performed each time it is run.

② The consequence of weak language support: uncertain variable types may bring unpredictable results; the engine needs to do a lot of work to support weak types, resulting in lower efficiency.

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.