Changes and improvements in PHP6 compared with PHP5 _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags sapi
Changes and improvements in PHP6 compared with PHP5. PHP6 has been around for some years. although it is still commonly used in PHP5, PHP6 is still a trend in the future. So what are the changes and improvements of PHP6 for PHP5? PHP 6 has been around for some years. Although PHP 5 is widely used, however, PHP 6 is still a trend in the future. So what changes have PHP 6 made for PHP 5 and what improvements have been made?

1. Unicode supported

Unicode support is inevitable. Although Unicode occupies a large amount of space, Unicode brings convenience, which far exceeds the disadvantages of space occupation. especially in the international world, hardware devices are becoming more and more powerful, the network speed is also greatly improved, so a small disadvantage can be ignored.

In addition, PHP can also be in. it is up to you to decide whether to enable Unicode in The INI file. this is a good idea. turning off Unicode support does not significantly improve PHP performance, the main influence is the function that needs to reference strings.

2. Register Globals will be removed

This is an important decision. many new PHP developers will think that Register Globals is very convenient, but ignore the potential security risks caused by Register Globals, this function is disabled on most hosts. in my opinion, when PHP4.3.x is used, the default value is disabled, the official removal of Register Globals from PHP6 also means that if the program is a product of the PHP3 era, it will be completely unusable. there is no other way to rewrite it. I believe that in the current PHP world, there should be very few programs still produced in the PHP3 era.

3. Magic Quotes will disappear

Magic Quotes is mainly used to automatically escape characters that need to be escaped. This function is also applicable to most PHP developers.

4. Safe Mode canceled

Honestly, I don't know where this mode is. cancel it and I won't be able to use it anyway.

5. the alias 'var' is 'public'

The var declaration in the class is changed to the public alias. it is believed that the decision is made to be compatible with PHP5. PHP6 can now be called OO language.

6. errors will be returned through reference

Now the compiler returns an error through reference. For example, $ a = & new B (), function & c (), the OO language is referenced by default, so you do not need to use it again.

7. zend. ze1 compatbility mode will be removed/Zend. ze1 compatible mode will be removed

PHP5 is compatible with the old PHP4, so in. in ini, you can choose whether to enable the compatibility mode because PHP5 uses the second generation parsing engine, but the compatibility mode is not capable of parsing the PHP4 syntax, so the product of the old era is removed.

8. Freetype 1 and GD 1 support will be missing

These two are Libs for a long time, so they are no longer supported. GD1 has already been replaced by GD2.

9. dl () is moved to SAPI

Dl () mainly enables designers to load extension Libs and is now moved to SAPI

10. remove Register Long Array

It is disabled by default from PHP5, and then removed in PHP6.

11. some Extension changes

For example, XMLReader and XMLWriter will no longer appear in Extension mode. they will be moved to the PHP core and enabled by default. ereg extension will be placed in PECL, it indicates that it will be removed from the PHP core, which is also to give way to the new regular expression extension. In addition, Fileinfo extension will also be imported into the PHP core.

12. APC will be imported to the core

This is a function to improve PHP performance. now it will be put into the PHP core and you can choose whether to enable APC.

13. Farewell to the starting label of ASP style

It turned out to be an attempt to help ASP developers turn to PHP. this practice is no longer needed now. finally, do not expect the performance of PHP6 to fully exceed PHP5, it is possible that the execution efficiency of PHP6 will be slower than that of PHP5, but it is expected that the PHP development team will strive to improve PHP 6 and surpass PHP 5.

Http://www.bkjia.com/PHPjc/752364.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/752364.htmlTechArticlePHP 6 has been out for some years, although it is still widely used PHP 5, but after all PHP 6 is still the future trend. So what changes have PHP 6 made for PHP 5 and what improvements have been made...

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.