CINXE.COM

PHP Versions Stats - 2017.1 Edition | Jordi's Ramblings

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="description" content="It&#039;s stats o&#039;clock! See 2014, 2015, 2016.1 and 2016.2 for previous similar posts. 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 ..."> <meta property="og:title" content="PHP Versions Stats - 2017.1 Edition | Jordi&#039;s Ramblings"/> <meta property="og:type" content="article" /> <meta property="og:url" content="https://seld.be/notes/php-versions-stats-2017-1-edition"/> <meta property="og:description" content="It&#039;s stats o&#039;clock! See 2014, 2015, 2016.1 and 2016.2 for previous similar posts. 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 ..." /> <title>PHP Versions Stats - 2017.1 Edition | Jordi&#039;s Ramblings</title> <link rel="home" href="https://seld.be"> <link rel="icon" href="/favicon.ico"> <link href="/feed.atom" type="application/atom+xml" rel="alternate" title="Jordi&#039;s Ramblings Atom Feed"> <script async src="https://www.googletagmanager.com/gtag/js?id=G-QGN4JJEDTM"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-QGN4JJEDTM'); </script> <!-- TODO self-host this --> <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,700,700i,800,800i" rel="stylesheet"> <link rel="stylesheet" href="/assets/build/css/main.css?id=d00f50ff97ec6d83fcce"> </head> <body class="flex flex-col justify-between min-h-screen text-gray-800 dark:text-green-500 leading-normal font-sans dark:font-mono bg-gray-100 dark:bg-gray-800"> <header class="flex items-center shadow bg-white dark:bg-gray-900 border-b dark:border-green-300 h-24 py-4" role="banner"> <div class="container flex items-center max-w-4xl mx-auto px-4 lg:px-8"> <div class="flex items-center"> <a href="/" title="Jordi&#039;s Ramblings home" class="inline-flex items-center"> <h1 class="text-lg md:text-2xl text-blue-800 dark:text-green-400 font-semibold hover:text-blue-600 dark:hover:text-green-200 my-0">Jordi&#039;s Ramblings</h1> </a> </div> <div id="vue-search" class="flex flex-1 justify-end items-center"> <search></search> <nav class="hidden lg:flex items-center justify-end text-lg"> <a title="Jordi&#039;s Ramblings Blog" href="/notes" class="ml-6 text-gray-700 hover:text-blue-600 dark:text-green-500 dark:hover:text-green-400 "> Blog </a> <a title="Jordi&#039;s Ramblings About" href="/about" class="ml-6 text-gray-700 hover:text-blue-600 dark:text-green-500 dark:hover:text-green-400 "> About </a> <a title="Jordi&#039;s Ramblings Atom Feed" href="/feed.atom" class="ml-6 text-gray-700 hover:text-blue-600 dark:text-green-500 dark:hover:text-green-400"> Feed </a> <a title="Dark Mode" class="ml-4 cursor-pointer toggle-dark dark:hidden inline-block">🕶</a> <a title="Light Mode" class="ml-4 cursor-pointer toggle-dark hidden dark:inline-block">☀</a> </nav> <button class="flex justify-center items-center bg-blue-500 border border-blue-500 dark:bg-green-400 dark:border-green-400 h-10 px-5 rounded-full lg:hidden focus:outline-none" onclick="navMenu.toggle()" > <svg id="js-nav-menu-show" xmlns="http://www.w3.org/2000/svg" class="fill-current text-white h-9 w-4" viewBox="0 0 32 32" > <path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/> </svg> <svg id="js-nav-menu-hide" xmlns="http://www.w3.org/2000/svg" class="hidden fill-current text-white h-9 w-4" viewBox="0 0 36 30" > <polygon points="32.8,4.4 28.6,0.2 18,10.8 7.4,0.2 3.2,4.4 13.8,15 3.2,25.6 7.4,29.8 18,19.2 28.6,29.8 32.8,25.6 22.2,15 "/> </svg> </button> </div> </div> </header> <nav id="js-nav-menu" class="w-auto px-2 pt-6 pb-2 bg-gray-200 dark:bg-gray-700 shadow hidden lg:hidden"> <ul class="my-0"> <li class="pl-4 list-none"> <a title="Jordi&#039;s Ramblings Blog" href="/notes" class="block mt-0 mb-4 text-sm no-underline text-gray-800 hover:text-blue-500 dark:text-green-300 dark:hover:text-green-100" >Blog</a> </li> <li class="pl-4 list-none"> <a title="Jordi&#039;s Ramblings About" href="/about" class="block mt-0 mb-4 text-sm no-underline text-gray-800 hover:text-blue-500 dark:text-green-300 dark:hover:text-green-100" >About</a> </li> <li class="pl-4 list-none"> <a title="Jordi&#039;s Ramblings Atom Feed" href="/feed.atom" class="block mt-0 mb-4 text-sm no-underline text-gray-800 hover:text-blue-500 dark:text-green-300 dark:hover:text-green-100" >Feed</a> </li> </ul> </nav> <main role="main" class="flex-auto w-full container max-w-4xl mx-auto bg-white dark:bg-black mt-6 p-6"> <h1 class="leading-none mb-2">PHP Versions Stats - 2017.1 Edition</h1> <p class="text-gray-700 dark:text-green-700 text-xl md:mt-0">Jordi Boggiano • May 7, 2017</p> <a href="/categories/news" title="View posts in news" class="inline-block bg-gray-300 text-gray-800 hover:bg-blue-200 dark:bg-gray-600 dark:text-green-200 dark:hover:bg-green-800 leading-loose tracking-wide uppercase text-xs font-semibold rounded mr-4 px-3 pt-px mb-10" >news</a> <a href="/categories/php" title="View posts in php" class="inline-block bg-gray-300 text-gray-800 hover:bg-blue-200 dark:bg-gray-600 dark:text-green-200 dark:hover:bg-green-800 leading-loose tracking-wide uppercase text-xs font-semibold rounded mr-4 px-3 pt-px mb-10" >php</a> <div class="border-b border-blue-200 dark:border-green-200 mb-10 pb-4" v-pre> <p>It's stats o'clock! See <a href="https://seld.be/notes/my-view-of-php-version-adoption">2014</a>, <a href="https://seld.be/notes/php-versions-stats-2015-edition">2015</a>, <a href="https://seld.be/notes/php-versions-stats-2016-1-edition">2016.1</a> and <a href="https://seld.be/notes/php-versions-stats-2016-2-edition">2016.2</a> for previous similar posts.</p> <p>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 <a href="https://packagist.org">packagist.org</a> logs of the last month for Composer installs done by someone. Composer sends the PHP version it is running with in its <code>User-Agent</code> header, so I can use that to see which PHP versions people are using Composer with.</p> <h2>PHP usage statistics</h2> <h3>May 2017 (+/- diff from November 2016)</h3> <table> <tr> <td style="width: 90px">All versions</td> <td></td> <td style="width: 30px"></td> <td style="width: 70px">Grouped</td> <td></td> </tr> <tr> <td>PHP 5.6.30</td> <td>14.73%</td> <td></td> <td>PHP 7.0</td> <td>36.12% (+1.11)</td> </tr> <tr> <td>PHP 7.0.15</td> <td>9.53%</td> <td></td> <td>PHP 5.6</td> <td>31.44% (-6.02)</td> </tr> <tr> <td>PHP 5.5.9</td> <td>6.12%</td> <td></td> <td>PHP 7.1</td> <td>17.64% (+16.28)</td> </tr> <tr> <td>PHP 7.0.17</td> <td>6.00%</td> <td></td> <td>PHP 5.5</td> <td>10.61% (-8.32)</td> </tr> <tr> <td>PHP 7.1.3</td> <td>5.88%</td> <td></td> <td>PHP 5.4</td> <td>3.11% (-2.29)</td> </tr> <tr> <td>PHP 7.1.4</td> <td>3.65%</td> <td></td> <td>PHP 5.3</td> <td>0.98% (-0.62)</td> </tr> </table> <p><img src="//seld.be/images/composer-2017-01.png?v2" alt="" /></p> <p>A few observations: With a big boost of PHP 7.1 installs, PHP 7 overall now represents over 50%. 5.3/5.4 are really tiny and even 5.5 is dropping significantly which is good as it is not maintained anymore since last summer. That's a total of 85% of installs done on supported versions, which is pretty good.</p> <p>And because a few people have asked me this recently, while HHVM usage is not included above in the graph it is at 0.36% which is a third of PHP 5.3 usage and really hardly significant. I personally think it's fine to support it still in libraries if it just works, or if the fixes involved are minor. If not then it's probably not worth the time investment.</p> <p>Also.. since I now have quite a bit of data accumulated and the pie chart format is kind of crappy to see the evolution, here is a new chart which shows the full historical dataset!</p> <p><img src="//seld.be/images/composer-graph-2017-01.png?v2" alt="" /></p> <p>It is pretty interesting I think as it shows that 5.3/5.4/5.5 had people slowly migrating in bunches and the versions peaked at ~50% of the user base. On the other hand 5.6/7.0/7.1 peak around 35% which seems to indicate people are moving on faster to new versions. This is quite encouraging!</p> <h2>PHP requirements in Packages</h2> <p>The second dataset is which versions are required by all the PHP packages present on packagist. I only check the require statement in their current master version to see what the latest is.</p> <h3>PHP Requirements - Current Master - May 2017 (+/- diff from November 2016)</h3> <table> <tbody> <tr><td style="width: 40px">5.2</td><td>2.13% (-0.22)</td></tr> <tr><td>5.3</td><td>37.6% (-3.65)</td></tr> <tr><td>5.4</td><td>28.38% (-1.74)</td></tr> <tr><td>5.5</td><td>17.11% (+0.13)</td></tr> <tr><td>5.6</td><td>9.37% (+3.15)</td></tr> <tr><td>7.0</td><td>4.61% (+1.53)</td></tr> <tr><td>7.1</td><td>0.81% (+0.81)</td></tr> </tbody></table> <p>A few observations: This is as usual moving pretty slowly. I think I can give up trying to advise for change, it doesn't seem to be working.. On the other hand it looks like Symfony is going to use 7.0 or 7.1 for it's v4 to come out later this year, so hopefully that will shake things up a bit and make more libraries also realize they can bump to PHP 7.</p> <h3>PHP Requirements - Recent Master - May 2017 (+/- diff from Current Master November 2016)</h3> <p>In response to Nikita's comment below I ran the requirements numbers for packages that had some sort of commit activity over the last year. This excludes all stale/done packages and looks much more encouraging, but the difference points are probably overly large because they compare to the old numbers which included everything, therefore take those with a pinch of salt, and in the next six months update I'll have more trusty numbers.</p> <table> <tbody> <tr><td style="width: 40px">5.2</td><td>1.52% (-0.83)</td></tr> <tr><td>5.3</td><td>23.15% (-18.1)</td></tr> <tr><td>5.4</td><td>24.41% (-5.71)</td></tr> <tr><td>5.5</td><td>23.7% (+6.72)</td></tr> <tr><td>5.6</td><td>16.81% (+10.59)</td></tr> <tr><td>7.0</td><td>8.73% (+5.65)</td></tr> <tr><td>7.1</td><td>1.67% (+1.67)</td></tr> </tbody></table> </div> <nav class="flex justify-between text-sm md:text-base"> <div> <a href="https://seld.be/notes/php-versions-stats-2016-2-edition" title="Older Post: PHP Versions Stats - 2016.2 Edition"> &LeftArrow; PHP Versions Stats - 2016.2 Edition </a> </div> <div> <a href="https://seld.be/notes/php-versions-stats-2017-2-edition" title="Newer Post: PHP Versions Stats - 2017.2 Edition"> PHP Versions Stats - 2017.2 Edition &RightArrow; </a> </div> </nav> </main> <footer class="bg-white dark:bg-gray-900 text-center text-sm mt-12 py-4" role="contentinfo"> <ul class="flex flex-col md:flex-row justify-center"> <li class="list-none md:mr-2"> <a href="https://twitter.com/seldaek">Twitter</a> </li> <li class="list-none md:mr-2"> <a href="mailto:j.boggiano@seld.be">E-Mail</a> </li> <li class="list-none md:mr-2"> <a href="https://github.com/Seldaek">GitHub</a> </li> <li class="list-none md:mr-2"> <a href="/wishlist">Wishlist</a> </li> <li class="list-none"> All content &copy; Jordi Boggiano 2006-2022. </li> </ul> </footer> <script src="/assets/build/js/main.js?id=d987125254011a3fac10"></script> <script> const navMenu = { toggle() { const menu = document.getElementById('js-nav-menu'); menu.classList.toggle('hidden'); menu.classList.toggle('lg:block'); document.getElementById('js-nav-menu-hide').classList.toggle('hidden'); document.getElementById('js-nav-menu-show').classList.toggle('hidden'); }, } </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10