To perform a Web script language requires three parts:
1 · Analyze the input code, translate and execute
2 · Functional section, functional requirements for executing language
3 · Part of the Web Server Dialog
Zend performs a small portion of the first portion and the second portion, and PHP performs the rest. Zend is the core of the language, performs some basic functions according to some pre-defined functions. PHP includes all external function modules.
PHP expansion can include three ways: 1 · External module extension; 2 · Compile modules and phps when compiling PHP; 3 · Modify the Zend Engine.
These three ways have advantages and disadvantages. Generally selecting the first one (such as the MYSQL library used in the common GD library and php5), the advantage is not to recompile PHP, and the harm is that the dynamic module is loaded requires additional time.
First look at three headers:
1 · The PHP.H file below Main contains many systems .h files, define a lot of constants, functions, and macros, determine if some functions exist depending on the system compilation environment, if there is no, compiling these functions written in the PHP code The macro definition is unified in different environments, but the function name is different, but the function name is different.
2 · The zend.h function under Zend defines some data structures, and some data structures are included, such as haveh and list.
3 · The zend_api.h file under Zend will define some functions as a macro, which is mainly used to compile the PHP code.