[0] New Features Of the Main PHP Versions from 7.0 to 8.0.
![[0] New Features Of the Main PHP Versions from 7.0 to 8.0.](https://www.adambiro.com/wp-content/uploads/2020/08/php-logo-h375.png)
This post wants to go through PHP’s main features from 7.0 to 8.0 in a bullet point style with some links to more details. I am doing so because I would like to check the new features of PHP 8.0, and a list like this can be helpful for what functionalities I need to check. By the way, some of these new features extend a preexisting attribute that was introduced in the previous PHP versions. So this is the best time for me to check the past PHP features in a retrospected style.
What were the new Features of PHP 7.0?
- https://www.tutorialspoint.com/php7/index.htm
- New Features Included:
- Scalar type declarations
- Return type declarations
- Null coalescing operator
- Spaceship operator
- Constant arrays using define()
- Anonymous classes
- Unicode codepoint escape syntax
- Closure::call()
- Filtered unserialize()
- IntlChar
- Expectations
- Group use declarations
- Generator Return Expressions
- Generator delegation
- Integer division with intdiv()
- Session options
- preg_replace_callback_array()
- CSPRNG Functions
What were the new features of PHP 7.2?
Released: 30 Nov 2017
- New Features Included:
- New object type hinting
- Scalar type hint was introduced in PHP 7.0
- https://wiki.php.net/rfc/object-typehint
- Parameter type widening
- Abstract method overriding
- Trailing comma in list syntax
- New Sodium extension
- New object type hinting
What are the new features of PHP 7.3?
Released: 06 Dec 2018
- New Features Included:
- Multibyte string functions
- Argon2 password hash enhancements
- More flexible heredoc and nowdoc syntaxes
What are the new features of PHP 7.4?
Released: 28 Nov 2019
- New Features Included:
- Arrow functions for cleaner one-liner functions
- Preloading to improve performance
- Support for typed properties
- Custom object serialization
- Unpacking inside arrays
- Weak references
- Improved type variance
What are the new features of PHP 8.0?
Release: Nov 26 2020
- New Features will include:
- JIT Compiler
- Union Types
- The null safe operator
- Named arguments
- Attributes
- Match expression
- Constructor property promotion
- New static return type
- New mixed type
- Throw expression
- Inheritance with private methods
- Weak maps
- Allowing
::class
on objects - Non-capturing catches
- Trailing comma in parameter lists
- New Stringable interface
- Create DateTime objects from the interface
- New:
- str_contains() function
fdiv()
function- str_starts_with() and str_ends_with() functions
get_debug_type()
functionget_resource_id()
function
- Abstract methods in traits improvements
- Object implementation of
token_get_all()
- Variable syntax tweaks
- Type annotations for internal functions
ext-json
always available
Conclusion & Closing
As it looks on the list above, PHP has evolved a lot in the past years. Developers implemented many great features already in the version of 7.0, which was much faster than PHP 5.6 because of the new PHP – Next-Gen engine. In the following posts, I will focus on the new features of PHP 8.0.