PHP 4.0 is a more efficient, more reliable Dynamic Web page development tool that runs faster than PHP 3.0 in most cases, and its script description is more powerful and complex, and the most notable feature is the increase in rate ratios. PHP4.0 These excellent performance is the result of a redesign of the PHP scripting engine: The engine is completely rewritten from the bottom of the Andigutmans and Zeev Suraski. The PHP4.0 script engine-the Zend engine-uses a more efficient "compile-execute" paradigm than the "execute-when-parse" model used in PHP 3.0.
PHP4 has added or enhanced many useful features on the basis of version 3.0, mainly as follows:
(1) Alias
In PHP4, you can use references to assign values to variables, which gives you a lot of flexibility in programming.
(2) expanded the API module
PHP 4.0 provides an extended PHP interface module for the Extended API module, which is significantly faster than the old API version. The existing and most commonly used interfaces of the PHP module are converted to interfaces that use this extension.
(3) Automatic resource release
PHP4 adds the reference counting function, the introduction of this new technology makes PHP4 has the automatic memory management function, reduced the developer's burden.
(4) Boolean type
PHP 4.0 supports Boolean types.
(5) Process generation
PHP 4.0 in the UNIX environment provides a very intelligent and common generation process, using a system generation technology called Automake/libtool.
(6) Com/dcom Support
PHP 4.0 provides com/dcom support (for Windows environments only) to seamlessly access and access COM objects.
(7) Compatibility with PHP 3.0 very good
PHP 4.0 is close to 100% with PHP 3.0 code backwards compatibility. Because of the improved architecture of PHP 4, there are some subtle differences, but most people will probably never be able to meet this situation.
(8) configuration
PHP4 redesigned and enhanced PHP. INI file, which makes use of PHP. INI to configure PHP is extremely easy, this file can be run by Apache (Unix system) or by Windows registration (Windows environment).
(9) Encryption support
PHP4 implements full encryption, which is a complete mycrypt library, and PHP 4.0 supports hash functions. BLOWFISH,TRIPLEDES,MD5, and SHA1 is also a number of cryptographic algorithms that can be used.
(10) Type check
PHP 4.0 supports the same operator for evaluating type checking: "= = =" (3 equals operator) to check between two values and their type. For example, the "3" ===3 will be considered false (the type is different), and "3" ==3 (equality judgment) will be considered true.
(11) FTP Support
PHP 4.0 supports FTP. Typically, you provide a network interface for downloading a large file through a modem connection. However, if you do need it, you can use PHP.
(PHP4) new function or function enhancement function
PHP 4.0 adds a number of functions, while also enhancing many of the existing function functions, here are some examples.
Array_count_values ()
Eval ()
foreach ()
Nclude ()
Ob_end_clean ()
Ob_end_flush ()
Ob_get_contents ()
Ob_start ()
Strip_tags ()
Unset ()
() "Here" print
The "Here" print of PHP 4.0 is similar to Perl, albeit completely different. "Here" is a useful way to print a bulk article, for example, in an HTML file, without omitting any character, such as a catalog tag.
(14) HTTP Session Fallback system
A fallback system for HTTP session management is implemented in PHP 4.0. By default, session identifiers are stored by cookies. If no cookies are supported or a cookie task fails, the session identifier is automatically created and carried in the URL's query string.
(15) ISAPI Support
PHP 4.0 can be used as an IIS plug-in as a personalized ISAPI module. This is more efficient than PHP 3.0, which runs as a CGI (an external program).
(16) Memory
PHP 4.0 can use memory more efficiently, resulting in less memory consumption, which is mainly due to the implementation of reference counting technology.
(17) Other class member functions
In PHP 4.0 you can invoke member functions of other classes in the scope or global scope of the member function itself. For example, you can overwrite a parent function with a child function and call the parent function in a child function.
(18) Multidimensional array
In PHP 4.0, a multidimensional array is supported using get,post,cookies data.
(19) Personalized HTTP session Support
HTTP session processing, including fallback system management, is implemented in PHP 4.0 by its new library function. Processing session in version 3.0 requires the use of Phplib and third party library functions, which are much slower than the session directly supported by PHP.
(20) Personalized Java support
PHP 4.0 supports the interaction with Java. This personalized Java support provides a simple and effective tool for PHP to create and use methods on Java objects.
(21) objects and arrays of nested groups
PHP 4.0 implements a more powerful object, removing the syntactic limitations of PHP's 3.0 kinds of existence. objects can be nested within an array and vice versa, and can be nested according to your needs.
(22) Object-oriented programming
PHP 4.0 provides extended functionality and new features for object-oriented programming and structuring classes and objects. PHP4 implements new technologies such as object overloading and referencing technology.
(23) Object overload support
Object overloading syntax allows third parties to use PHP4 object-oriented features to access their own functionality based on the Object-oriented class library. A COM module that uses this feature has been implemented.
(24) Output buffer support
PHP provides a collection of output buffering functions. Output buffering support allows you to write the package function function to compress the buffer. The output buffering support in PHP4 allows the HTML header information to be stored, regardless of whether the HTML body is output or not. Header information (header (), content type, and cookies) does not use buffering.
(25) added the Pcre library
PHP 4.0 includes a Perl-compatible regular expression (PCRE) library, which is bound to PHP with the normal regex library. Split and replace PCRE features are supported. There are some subtle differences between PCRE and Perl regular expressions.
(php.ini) Documents
php.ini files are redesigned in PHP4.0, and the PHP configuration used is php.ini easier and more efficient. All files can be operated by Apache at run time (in Apache environment) or by the Windows Registry (under Windows). The configuration instructions that are added to the php.ini file are automatically supported in all relevant modules.
(27) Reference count
PHP 4.0 provides a reference count for each numeric value in the system, including resources. Once a resource is no longer referenced by any variable, it is automatically freed to conserve memory resources. The most obvious example of using this feature is a built-in SQL query loop statement. In PHP 3.0, each recursive additional SQL result collection repeats the application memory until the script completes, and the memory of the resulting collection is freed.
(28) Support references
You can change the value of a variable by referencing it.
(29) Run-time binding of a function
PHP 4.0 's Run-time bindings feature allows you to call before they are declared, regardless of whether the declaration is after the code or at run time.
(30) Run-time Information for class
PHP 4.0 supports accessing the following class information at run time: the class name of an object, the class name of the parent class of an object, and the name of the object function.
(31) Server Abstraction Layer
Provides an enhanced SAPI (server API) interface for supporting Web servers, PHP 4. 0 an integral part. This server abstraction layer provides common Web server interface support, supports multi-threaded Web servers, and provides transparent support for most Web servers, including Apache, IIS (ISAPI), and the AOL server.
(32) Light display of syntax
The light display of the PHP 4.0 syntax allows the developer to see the source code instead of the script, which is more powerful than PHP 3. More effective in 0. It runs faster, executes better, and produces more compact HTML code.
(33) Changing the value of a variable by reference
PHP 4.0 is a variable assignment supported by a reference, and the value of any of the 2 variables of the association is changed, and the value of the other variable is similarly changed, similar to the pointer type in C.
(34) A variable reference in a reference string
PHP 4.0 enhances the reference to a variable in a reference string. For example, this example is not possible in PHP 3.0: print "${a[0]->bingo}";