PHP 6 has been around for some years. Although PHP 5 is widely used, 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.