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.
PHP usage statistics
May 2019 (+/- diff from November 2018)
|PHP 7.2.17||8.80%||PHP 7.2||38.98% (+6.35)|
|PHP 7.2.18||8.13%||PHP 7.1||25.59% (-6.11)|
|PHP 7.3.5||7.95%||PHP 7.3||15.35% (+15.35)|
|PHP 7.1.29||5.19%||PHP 7.0||9.43% (-9.97)|
|PHP 7.0.33||4.90%||PHP 5.6||7.68% (-3.96)|
|PHP 5.6.40||4.08%||PHP 5.5||1.52% (-0.86)|
A few observations: PHP 7.3 is growing almost as well as 7.2 last year. With PHP 5.6 and 7.0 reaching end of life at the end of 2018, the number of people using maintained PHP versions dropped to 80% (from 84%), which is really not as bad as I expected as 31% of people had to upgrade. PHP 5 usage across all versions is now around 10%.
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 2019 (+/- diff from Recent Master November 2018)
The push towards PHP 7.1 and 7.2 happened even faster than in the previous six months. The most required PHP version is still one that is still maintained which is also pretty good news!