PHP version stats: July, 2023

Written on 2023-07-01

Once again, I'm writing my summary of which PHP versions are used across the community. You can read the previous edition here, but I'll also include historic data in this post.

As always, it's important to note that I'm working with the data available to us. That means that these charts are not a 100% accurate representation of the PHP community as a whole, but they are an accurate representation of one of the most prominent parts of PHP: the packagist ecosystem.

This blog post was sponsored by Private Packagist - the private Composer repository from the creators and maintainers of Composer & Packagist.

Usage Statistics

Let's start with the percentage of PHP versions being used today, and compare it to the previous three editions, note that I've omitted all versions that don't have more than 1% usage:

Version 2022-01 2022-07 2023-01 2023-07
7.1 2.4% 1.9% 1.8% 1.3%
7.2 6.6% 5.1% 4.3% 4.3%
7.3 12.0% 8.0% 5.3% 4.2%
7.4 43.9% 38.4% 27.7% 19.9%
8.0 23.9% 20.6% 16.2% 12.3%
8.1 9.1% 24.5% 38.8% 39.3%
8.2 0.0% 0.0% 4.7% 17.2%

Visualizing this data looks like this:

Evolution of version usage

It's important to know which PHP versions are currently still supported: PHP 8.2 and PHP 8.1 are still receiving updates. PHP 8.0 is still getting security updates until the end of November, this year. That means that PHP 7.4 and below don't receive any updates more, and should be considered end of life.

In total, that's around 30% of packagist downloads by outdated and insecure version of PHP. At the beginning of this year, that number was closer to 40%, meaning we see a steady decline — a good thing!

Check out my latest video: DX matters

Moving on to the all-time overview chart, here you can see the evolution of version usage across time:

All time evolution

It seems that PHP 8.1 saw the biggest growth over time since PHP 7.4 and PHP 5.5. PHP 8.2, in comparison, seems to make a slower start. It's also interesting to note a relative high percentage of PHP 8.1 two years in a row. Granted, PHP 8.1 was a pretty solid release with features like enums and readonly properties. It'll be interesting to see how this graph evolves next year, when PHP 8.1 moves in security fixes only mode.

This blog post was sponsored by Private Packagist - the private Composer repository from the creators and maintainers of Composer & Packagist.

Required versions

Next, I used Nikita's popular package analyzer to download the 1000 most popular composer packages. I wrote a script that scans these packages to determine their minimum required version. Here are the results:

Version 2022-01 2022-07 2023-01 2023-07
5.2 10 10 10 7
5.3 83 77 78 65
5.4 43 40 40 31
5.5 42 35 37 21
5.6 49 42 43 32
7.0 29 29 30 24
7.1 190 153 159 125
7.2 133 130 144 133
7.3 116 104 106 56
7.4 69 86 98 97
8.0 160 94 103 144
8.1 - 125 129 107
8.2 - - - 94

There are two important notes to make here.

  1. This tables shows the minimum required version. That means that packages with a minimal version of, for example, 8.0, could also support PHP 8.1 or and PHP 8.2.
  2. If you count the numbers, you'll notice there are some differences between each year. Not every package lists a valid version string.

Instead of comparing absolute numbers, it's best to plot this data into a chart for a relative comparison, so that we can see changes over time:

Minimal PHP requirement over time

There seems to be a pretty big leap in PHP 8.0 and PHP 8.1 being the minimal versions — a good thing. After all, the open source community plays a big part in pushing the community forward by increasing their minimal required version.


That's all data I have to share for this edition of PHP's version stats. You can always reach me via email if you want to share your thoughts or have questions. You can also subscribe to my newsletter if you want to receive updates about this blog in the future.

Join over 14k subscribers on my mailing list: I write about PHP, programming, and keep you up to date about what's happening on this blog. You can subscribe by sending an email to brendt@stitcher.io.

Things I wish I knew when I started programming

Things I wish I knew when I started programming cover image

This is my newest book aimed at programmers of any skill level. This book isn't about patterns, principles, or best practices; there's actually barely any code in it. It's about the many things I've learned along the way being a professional programmer, and about the many, many mistakes I made along that way as well. It's what I wish someone would have told me years ago, and I hope it might inspire you.

Read more

Comments

Loading…
No comments yet, be the first!
Noticed a tpyo? You can submit a PR to fix it.
HomeRSSNewsletterDiscord© 2025 stitcher.io