Home > Article > Backend Development > What are the new features of php7?
php7 new features include: PHPNG code merged into PHP7; reduced memory consumption; scalar type declaration, can enforce parameter and return types; consistent 64-bit support; improved exception hierarchy; deprecated SAPI and extensions removed; new null coalescing operator (?) added; support for anonymous additions; support for zero-cost assertion additions.
Summary of new features in PHP7
Improved performance - merge PHPNG code into PHP7 at the same speed as PHP 5 twice.
Reduced memory consumption - Optimized PHP 7 uses fewer resources.
Scalar type declarations - parameter and return types can now be enforced.
Consistent 64-bit Support - Consistent support for 64-bit architecture machines.
Improved Exception Hierarchy - The Exception Hierarchy has been improved. Many fatal errors are converted into exceptions - The exception scope has been increased to cover many fatal errors which are converted into exceptions.
Secure Random Number Generator - Added new secure random number generator API.
Deprecated SAPIs and Extensions Removed - Various old and unsupported SAPIs and extensions have been removed from the latest version.
Null Coalescing Operator (?) - New null coalescing operator added.
Return and scalar type declarations - Support for added return types and parameter types.
Anonymous class - supports anonymous addition.
Zero-cost assertions - Support for zero-cost assertions was added.
Recommended tutorial: "php tutorial"
The above is the detailed content of What are the new features of php7?. For more information, please follow other related articles on the PHP Chinese website!