PHP First Acquaintance

Source: Internet
Author: User
Tags php language

1. What is PHP?

PHP Full name Php:hypertext preprocessor is an open-source scripting language that runs on the server.

So what is a scripting language? The antithesis of the scripting language is not a high-level programming language, it is also a programming language. Scripting languages and "non-scripting languages" can be seen as the difference between "analytic language" and "compiled language": A compiled language will link code compilation to executable machine code for a specific platform before it runs, and the parsing language is not compiled by line until run time.

2. PHP Language structure:

PHP from bottom to top can be divided into 4 layers system:

①zend Engine: Responsible for compiling PHP code into opcode (operating code abbreviation: execution code), and execute them. Note that this is not a machine code, machine code is CPU-oriented, the opcode is for the Zend engine, in the function can be Zend engine analogy to do Java virtual machine.

②extensions: Class library, function library, defines a variety of data structures and functions.

③sapi:server application Programming Interface, it is obvious that this is an intermediate layer to reduce the coupling between the bottom and the upper layer. Simply put, a service that calls various extensions layers encapsulates a more powerful service for upper-level application invocation.

④ Upper Application: The user writes the PHP project.

3. What are the advantages and disadvantages of PHP?

Advantages:

① simple: syntax is simple, and PHP generally does not carry out complex logic and complex operations.

② development efficiency: Many of the development of commonly used functions have been packaged well, some people play said to write function is to find "xxx function function called what again".

③ is free, open source, and can be cross-platform because it is an analytic language.

Disadvantages:

① is inefficient: Because PHP is a parsing language, each run will have a more "compile" step than the compiled language.

② supports the consequences of weak language: Uncertain variable types can bring unpredictable results, and the engine needs to do a lot of work to support weak types leading to inefficiencies.

First acquaintance with 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.