An exclusive tutorial on PHP versions and their compatibility. Get to know about its entire history along with its features and a detailed comparison of its different versions:
If you want to realize how PHP got where it is today, you need to explore the history of PHP.
In this tutorial, we will cover the early days of PHP, the PHP mascot, comparisons of different PHP versions, current PHP versions, new features of the latest version, and frequently asked questions.
Let’s start our historical journey!
=> Series of Simple PHP Tutorials
Table of Contents:
PHP Versions: A Detailed Study of Supported Versions
When it Began
PHP was designed by Rasmus Lerdorf in 1994, and the public version of the language was released in 1995. He wrote many Common Gateway Interface (CGI) programs in C language on his personal homepage. In the early days, PHP was known as Personal Home Page.
PHP Mascot
The mascot of the PHP project is a blue elephant with the PHP logo as shown in the below image. It was designed by Vincent Pontier in 1998 and some changes were made over the years.
PHP Versions
The following table shows a comparison between the different versions of PHP:
Version | Release Date | Latest Release | Currently Supported/Not Supported | Supported Until |
---|---|---|---|---|
Version 1.0 | 8 June 1995 | ———————- | Currently not supported | ————————– |
Version 2.0 | 1 November 1997 | ———————- | Currently not supported | ————————– |
Version 3.0 | 6 June 1998 | Version 3.0.x (latest) | Currently not supported | 20 October 2000 |
Version 4.0 | 22 May 2000 | Version 4.0.6 | Currently not supported | 23 June 2001 |
Version 4.1 | 10 December 2001 | Version 4.1.2 | Currently not supported | 12 March 2002 |
Version 4.2 | 22 April 2002 | Version 4.2.3 | Currently not supported | 6 September 2002 |
Version 4.3 | 27 December 2002 | Version 4.3.11 | Currently not supported | 31 March 2005 |
Version 4.4 | 11 July 2005 | Version 4.4.9 | Currently not supported | 7 August 2008 |
Version 5.0 | 13 July 2004 | Version 5.0.5 | Currently not supported | 5 September 2005 |
Version 5.1 | 24 November 2005 | Version 5.1.6 | Currently not supported | 24 August 2006 |
Version 5.2 | 2 November 2006 | Version 5.2.17 | Currently not supported | 6 January 2011 |
Version 5.3 | 30 June 2009 | Version 5.3.29 | Currently not supported | 14 August 2014 |
Version 5.4 | 1 March 2012 | Version 5.4.45 | Currently not supported | 3 September 2015 |
Version 5.5 | 20 June 2013 | Version 5.5.38 | Currently not supported | 10 July 2016 |
Version 5.6 | 28 August 2014 | Version 5.6.40 | Currently not supported | 31 December 2018 |
Version 6.0 | Not released | ———————- | ——————————– | ————————– |
Version 7.0 | 3 December 2015 | Version 7.0.33 | Currently not supported | 10 January 2019 |
Version 7.1 | 1 December 2016 | Version 7.1.33 | Currently not supported | 1 December 2019 |
Version 7.2 | 30 November 2017 | Version 7.2.34 | Currently not supported | 30 November 2020 |
Version 7.3 | 6 December 2018 | Version 7.3.26 | Currently supported (security support only) | 6 December 2021 |
Version 7.4 | 28 November 2019 | Version 7.4.15 | Currently supported | 28 November 2022 |
Version 8.0 | 26 November 2020 | Version 8.0.2 | Currently supported | 26 November 2023 |
Version 8.1 | 21 December 2023 | ———————- | ——————————– | 21 December 2023 |
[data source]
Note: Versioning
Let’s consider version 8.0.2 as an example. Here, 8 represents the major version, 0 represents the minor version and 2 represents the patch number.
If you have installed PHP on your machine, you can check the PHP version installed by typing the command php –v in the relevant command prompt.
Current PHP Versions
As you see in the above table, most of the versions are currently not supported. Versions that currently support are listed in the below table with more details:
Version | Active Support | Active Support Until | Security Support | Security Support Until |
---|---|---|---|---|
Version 7.3 | No | 6 Dec 2020 | Yes | 6 Dec 2021 |
Version 7.4 | Yes | 28 Nov 2021 | Yes | 28 Nov 2022 |
Version 8.0 | Yes | 26 Nov 2022 | Yes | 26 Nov 2023 |
Active support provides fixes for reported bugs and security issues. Security support provides support for critical security issues only.
Note: If you are dealing with an unsupported version, it is important to upgrade to the latest version (at least to a currently supported version) as soon as possible to avoid exposure to security vulnerabilities.
What is New in PHP 8
The latest version is PHP 8 (8.0 or 8.0.2), and it has many new features.
Some of the new features are listed below:
- Named arguments: Only need to specify the required parameters (no need to specify optional parameters). Arguments are also order-independent and self-documented.
- Support for attributes: Attributes help to add meta-data to functions, classes, etc.
- Class constructor property promotion – Provides less boilerplate code for defining and initializing class properties.
- Union types: A union type accepts values of multiple types of function parameters, class properties, and return types. Before version 8.0, it only accepts values of a single type.
- Match expression: It can return values without lengthy statements like in switch statements.
- Nullsafe operator
- Number comparison if compared with a numeric string
- Consistent type errors when using internal functions
- JIT compilation
- More strict type checks for bitwise operators and arithmetic operators
- Validation for abstract trait method
- Magic methods with correct signatures
- Engine warnings reclassification
- Fatal errors for method signature incompatibilities
- The at (@) operator does not silence fatal errors
- Inheritance using private methods
- A new pseudotype called mixed
- Use static as a return type
- Internal function types
- Weak Map class: A WeakMap holds arbitrary values for objects without preventing those objects from being garbage collected.
- Stringable interface
- The following new functions were added:
- str_contains() function
- str_starts_with() function
- str_ends_with() function function
- fdiv() function
- get_debug_type() function
- get_resource_id() function
- Object-based token_get_all() function (alternative) – It returns an array of objects.
- New DOM Traversal and Manipulation APIs
Suggested Reading =>> PHP Laravel Framework
Frequently Asked Questions
In this section, we will discuss some of the FAQs related to the history of PHP. These questions will help you to prepare for your examinations and interviews confidently.
1. Who invented PHP?
Rasmus Lerdorf invented PHP.
2. Is PHP used anymore?
Yes, it is still widely used for web development.
3. What are the versions of PHP?
Currently, there are seven versions of PHP named as PHP version 1.0, version 2.0, version 3.0, version 4.0, version 5.0, version 7.0, and version 8.0.
4. Which is the latest PHP version?
8.0 is the latest PHP version.
5. Is PHP 7.4 Stable for WordPress?
Yes, the latest WordPress PHP version recommended by WordPress.org is PHP 7.4.
6. Does the PHP version affect speed?
Yes, it affects speed.
Conclusion
Rasmus Lerdorf designed PHP in 1994, and the first public release was in 1995. The mascot of the PHP project is an elephant. Most of the old versions are currently not supported. The latest version is PHP 8 which came with several new features.
PREV Tutorial | NEXT Tutorial