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
November 2017 (+/- diff from May 2017)
A few observations: I find it quite incredible that PHP 7.1 is now the most used version, even though Ubuntu LTS does not yet ship with it. I don’t know if it means people use Docker or alternative PPAs but regardless it is good news! For the first time since I started these blog posts, the version usage actually matches the order in which they were released, with the older ones having less and less usage. That’s also great news. We have a total of 90% of installs done on PHP versions that are still maintained, which is awesome. If you are still on 5.6 or 7.0 though you only have one year of security fixes left so consider upgrading to 7.2 which should come out in the next week or two.
Here is the aggregate chart covering all my blog posts.
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 – November 2017 (+/- diff from Recent Master May 2017)
This moves at a decent pace with EOL’d versions slowly being abandoned. I still think it could go faster though 😉 Please consider bumping to PHP 7.0 at the very least when you update your libraries.