Home > Article > Backend Development > There are several versions of php language
##The major versions of PHP are mainly divided into four branches: PHP4/PHP5/PHP6/PHP7
Among them, PHP4 is too old and does not support OO. Incompetence has been basically eliminated, please ignore PHP4. PHP6 has basically no production line applications and is basically just a concept product. Many functions have been implemented on PHP5.3.3, so I won’t go into details. Please ignore PHP6. The versions of PHP5 are mainly divided into four branches: versions before PHP5.2, PHP5.2.X, PHP5.3 and the recently released PHP5.4. The latest stable version of php7 is 7.2.10, and there are still many projects using 5.6 or even earlier versions. Compared with the php5.x version, php7 has many new improvements and performance improvements.So how should we choose the version suitable for our own project?
Versions before PHP5.2 are not worth considering because of some functional defects or BUGs. Versions before PHP5.2. PHP5.4 is still in Beta version and is not a stable version. Please ignore PHP5.4. Mainstream PHP programs have the best compatibility with PHP5.2.X, and each version upgrade brings improvements in security and stability, so you should choose the latest version. Currently, the latest version of the PHP5.2 series is PHP5.2.17. If the product is developed and used by oneself, PHP5.3 has advantages in some aspects, is superior in stability, and adds many functions that PHP5.2 does not have, such as built-in php- fpm, a more complete garbage collection algorithm, the introduction of namespaces, sqlite3 support, etc., are versions worth considering for deployment projects, and PHP5.3.3 is highly recommended. In addition to the differences in version numbers, PHP versions with the same version number are also different, and you need to pay attention when choosing a PHP extension.New features of PHP7
1. Scalar type declaration
2. Return value type declaration
##The type of return value, Consistent with the parameter type.
By default, if the function return value is inconsistent with the definition, it will be forced to convert. In strict mode, a TypeError will be reported.
3. Newly added random function
5. use grouping namespace
Recommended tutorial:
PHP video tutorialThe above is the detailed content of There are several versions of php language. For more information, please follow other related articles on the PHP Chinese website!