Exploring PHP Versions and Compatibility

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated November 21, 2024
Edited by Kamila

Edited by Kamila

Kamila is an AI-based technical expert, author, and trainer with a Master’s degree in CRM. She has over 15 years of work experience in several top-notch IT companies. She has published more than 500 articles on various Software Testing Related Topics, Programming Languages, AI Concepts,…

Learn about our editorial policies.

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

PHP Versions: A Detailed Study of Supported Versions

PHP 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.

mascot

PHP Versions

The following table shows a comparison between the different versions of PHP:

VersionRelease DateLatest ReleaseCurrently Supported/Not SupportedSupported Until
Version 1.08 June 1995———————-Currently not supported————————–
Version 2.01 November 1997———————-Currently not supported————————–
Version 3.06 June 1998Version 3.0.x (latest)Currently not supported20 October 2000
Version 4.022 May 2000Version 4.0.6Currently not supported23 June 2001
Version 4.110 December 2001Version 4.1.2Currently not supported12 March 2002
Version 4.222 April 2002Version 4.2.3Currently not supported6 September 2002
Version 4.327 December 2002Version 4.3.11Currently not supported31 March 2005
Version 4.411 July 2005Version 4.4.9Currently not supported7 August 2008
Version 5.013 July 2004Version 5.0.5Currently not supported5 September 2005
Version 5.124 November 2005Version 5.1.6Currently not supported24 August 2006
Version 5.22 November 2006Version 5.2.17Currently not supported6 January 2011
Version 5.330 June 2009Version 5.3.29Currently not supported14 August 2014
Version 5.41 March 2012Version 5.4.45Currently not supported3 September 2015
Version 5.520 June 2013Version 5.5.38Currently not supported10 July 2016
Version 5.628 August 2014Version 5.6.40Currently not supported31 December 2018
Version 6.0Not released———————-——————————–————————–
Version 7.03 December 2015Version 7.0.33Currently not supported10 January 2019
Version 7.11 December 2016Version 7.1.33Currently not supported1 December 2019

Version 7.230 November 2017Version 7.2.34Currently not supported30 November 2020
Version 7.36 December 2018Version 7.3.26Currently supported (security support only)6 December 2021
Version 7.428 November 2019Version 7.4.15Currently supported28 November 2022
Version 8.026 November 2020Version 8.0.2Currently supported26 November 2023
Version 8.121 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:

VersionActive SupportActive Support UntilSecurity SupportSecurity Support Until
Version 7.3No6 Dec 2020Yes6 Dec 2021
Version 7.4Yes28 Nov 2021Yes28 Nov 2022
Version 8.0Yes26 Nov 2022Yes26 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

Was this helpful?

Thanks for your feedback!

Leave a Comment