PHP is currently in version 7.4, which was officially launched in November 2019, and in addition to this version, versions 7.2 and 7.3 are still active.
Each version of PHP has a life cycle of 2 years from its official release (stable version), this means that over that time bugs and security problems that are reported by users and the developer community will be fixed and made available at regular point versions.
After this period of 2 years in which active support takes place, each version starts to receive 1 year of additional support where only critical security problems will be corrected and releases of these updates made as needed, depending on the volume of corrections.
At the end of these 3 years the version loses support, entering EOL (End of Life). It is at this point that hosting companies update the versions available in their settings and developers and companies must (or at least should) update their applications.
We currently have 3 active versions: 7.2, 7.3 and 7.4. Since version 7.2 is already in the period of additional support, receiving only security updates, and that support ends on November 30, 2020.
Below is a table with information related to the active versions and their respective release and end support dates.
By updating the PHP version you gain both security and performance, as well as new features that are implemented with each version.
For example, version 7.3 brought as news:
- Heredoc and Nowdoc syntax flexibility;
- Allow comma to the right in function and method calls;
- Option to make json_encode and json_decode throw exceptions on errors;
- Referral assignments in list();
- Is_countable() function.
Version 7.4 brought new features:
- Typed Properties
- Arrow Functions
- Spread Operator on Arrays
- Null coalescing assignment operator
- FFI (foreign function interface)
For PHP 8 it is promising the implementation of JIT compilation (Just In Time), which is a way to optimize the execution code.
If you keep your applications running always under the latest stable version of PHP, you can take advantage of all these features and still have a better quality of security.
Be sure to update the version of PHP on the server where your application is running and also update the application itself.