PHP6 new characteristic Analysis _php skill

Source: Internet
Author: User
Tags apc php website safe mode sapi zend

This paper describes the new features of PHP6. Share to everyone for your reference, specific as follows:

1. Support for Unicode

The support of Unicode is inevitable, although Unicode occupies more space, but the convenience of Unicode, far more than occupy the shortcomings of space, especially in the internationalization of today, more and more hardware equipment, the speed is also greatly improved, such a small shortcoming can be ignored. Another point, PHP can also be set in the. ini file to open support for Unicode, the right to decide on your own, this is a good idea, turn off Unicode support, PHP performance does not have a significant increase, the main effect is the need to reference a string of functions.

2.Register Globals will be removed

This is an important decision to say that many new PHP developers will find the register globals full of convenience, but ignore the register globals will bring procedural security problems, most of the host on this feature is off, Impression from the beginning of the php4.3.x version, this default setting value is off state, PHP6 formally removed register globals also represents if the program is by the PHP3 era of products, will be completely unusable, in addition to rewriting a way, there is no other method. Believe that the current PHP world, still using the PHP3 era of the resulting procedures should be very few.

3.Magic quotes will disappear

Magic quotes mostly automatically escapes characters that need to be escaped, and this feature removes the leaves in accordance with most
Count the voices of PHP developers.

4.Safe Mode Cancellation

Frankly speaking, this model does not know where is not good, cancel it, it is not used

5. ' var ' Alias ' Public '

The Var declaration in the class becomes a public alias and is believed to be a decision to be compatible with PHP5, and PHP6 can now be called an OO language.

6. Returning by reference will make an error

Now returning the compiler via a reference will cause an error such as $a =& new B (), function &c (), and the OO language is referenced by default, so there is no need to use & again.

7.zend.ze1 compatbility mode will be removed.

ZEND.ZE1 compatibility mode will be removed, PHP5 is compatible with the old PHP4, so in. ini, you can choose whether to open the compatibility mode, because PHP5 is using the second-generation parsing engine, but the compatibility mode is not the absolute ability to parse the PHP4 syntax, so the artifacts of the old-time are removed.

8.Freetype 1 and GD 1 support will not be visible

These two are very long libs, so no longer support, GD1 has already been replaced by the GD2 now.

9.DL () moved to SAPI

DL () is primarily for designers to load extension Libs and is now moved to SAPI

10.Register Long Array Removal

From the PHP5, the default is off, and then the PHP6 is formally removed.

11. Changes to some extension

For example, XMLReader and XMLWriter will no longer appear as extension, they will be moved into the core of PHP, and the default is to open, Ereg extension will be put into pecl, representing that it will be moved out of the PHP core, This is also to give way to the new regular expression extension, in addition, Fileinfo extension will also be imported into the core of PHP.

12.APC will be imported into the core

This is a function to improve PHP performance, now it will be placed in the PHP core, and can choose whether to enable APC

13. Bid farewell to the ASP-style start tag

The original is to please the ASP developers to use PHP, now no longer need this practice, and finally, do not expect PHP6 performance can be fully exceeded PHP5, it is possible that PHP6 execution efficiency than PHP5 will come slower, but can be expected, The PHP development team will strive to improve PHP5, beyond PHP5.

So, friends who are interested in PHP6 can now download it from the official PHP website, and try to see if these features are really reflected in the PHP6.

I hope this article will help you with the PHP program design.

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.