A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org logs of the last month for Composer installs done by someone. Composer sends the PHP version it is running with in its
User-Agent header, so I can use that to see which PHP versions people are using Composer with. CI environments are excluded on a best-effort basis.
PHP usage statistics
May 2020 (+/- diff from November 2019)
|PHP 7.4.5||9.25%||PHP 7.3||30.05% (-5.19)|
|PHP 7.3.17||7.10%||PHP 7.2||27.49% (-4.17)|
|PHP 7.2.24||5.41%||PHP 7.4||20.06% (+14.02)|
|PHP 7.3.15||5.15%||PHP 7.1||11.55% (-3.72)|
|PHP 7.1.33||4.99%||PHP 5.6||4.99% (-1.92)|
|PHP 7.2.30||4.77%||PHP 7.0||4.00% (-2.04)|
A few observations: It's the COVID-19 edition, March/April has plateaued a bit, and probably people waiting for Ubuntu 20.04 LTS to upgrade did not help. But things are still moving at pretty much the same speed as usual. We are back at 78% of people using maintained PHP versions, and the PHP 7 range makes up over 93% so it is really time to bury PHP 5.
Here is the aggregate chart covering all my blog posts and the last five years.
PHP requirements in Packages
The second dataset is which versions are required by the PHP packages present on packagist. I only check the require statement in their current master version to see what the latest requirement is, and the dataset only includes packages that had commits in the last year to exclude all EOL'd projects as they don't update their requirements.
PHP Requirements - Recent Master - May 2020 (+/- diff from Recent Master November 2019)
Back in November PHP 7.2 was the big winner and that is still the case. The most required PHP version is also still 7.1. According to the charts above I would say it's rather time to require 7.3, but if you are waiting to jump directly up to PHP 8 and all its goodies I can understand that too!