CINXE.COM
PHP Versions Stats - 2015 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's that time of the year again, where I figure it's time to update my yearly data on PHP version usage. Last year's post showed 5.5 as the main winner and 5.3 declining rapidly. Let's see what 2015 brought. 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 packag..."> <meta property="og:title" content="PHP Versions Stats - 2015 Edition | Jordi's Ramblings"/> <meta property="og:type" content="article" /> <meta property="og:url" content="https://seld.be/notes/php-versions-stats-2015-edition"/> <meta property="og:description" content="It's that time of the year again, where I figure it's time to update my yearly data on PHP version usage. Last year's post showed 5.5 as the main winner and 5.3 declining rapidly. Let's see what 2015 brought. 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 packag..." /> <title>PHP Versions Stats - 2015 Edition | Jordi'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'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'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'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'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'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'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'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'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'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 - 2015 Edition</h1> <p class="text-gray-700 dark:text-green-700 text-xl md:mt-0">Jordi Boggiano • November 23, 2015</p> <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 that time of the year again, where I figure it's time to update my yearly data on PHP version usage. <a href="http://seld.be/notes/my-view-of-php-version-adoption">Last year's post</a> showed 5.5 as the main winner and 5.3 declining rapidly. Let's see what 2015 brought.</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 28 days for <code>GET /packages.json</code> which represents a composer update 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. Of course this data set is probably biased towards development machines and CI servers and as such it should also be taken with a grain of salt.</p> <h2>PHP usage statistics</h2> <p>I have two datasets, from November 2014 and today, which shows the progression of various versions. Any version below 3% usage has been removed to keep things readable.</p> <h3>November 2014</h3> <table> <tr> <td style="width: 90px">All versions</td> <td></td> <td></td> <td style="width: 30px"></td> <td style="width: 70px">Grouped</td> <td></td> <td></td> </tr> <tr> <td>Total</td> <td>11556916 </td> <td>100.00%</td> <td></td> <td>Total</td> <td>11556916 </td> <td>100.00%</td> </tr> <tr> <td>PHP 5.5.9</td> <td>2475970</td> <td>21.42%</td> <td></td> <td>PHP 5.5</td> <td>5647892</td> <td>48.87%</td> </tr> <tr> <td>PHP 5.4.4</td> <td>1022498</td> <td>8.85%</td> <td></td> <td>PHP 5.4</td> <td>3305929</td> <td>28.61%</td> </tr> <tr> <td>PHP 5.5.17</td> <td>678997</td> <td>5.88%</td> <td></td> <td>PHP 5.3</td> <td>1716653</td> <td>14.85%</td> </tr> <tr> <td>PHP 5.5.16</td> <td>529227</td> <td>4.58%</td> <td></td> <td>PHP 5.6</td> <td>886260</td> <td>7.67%</td> </tr> <tr> <td>PHP 5.3.3</td> <td>509101</td> <td>4.41%</td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>PHP 5.3.10</td> <td>479750</td> <td>4.15%</td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>PHP 5.6.0</td> <td>391633</td> <td>3.39%</td> <td></td> <td></td> <td></td> <td></td> </tr> </table> <h3>November 2015</h3> <table> <tr> <td style="width: 90px">All versions</td> <td></td> <td></td> <td style="width: 30px"></td> <td style="width: 70px">Grouped</td> <td></td> <td></td> </tr> <tr> <td>Total</td> <td>14539303 </td> <td>100.00%</td> <td></td> <td>Total</td> <td>14539303 </td> <td>100.00%</td> </tr> <tr> <td>PHP 5.5.9</td> <td>4307667</td> <td>29.63%</td> <td></td> <td>PHP 5.5</td> <td>7368033</td> <td>50.68%</td> </tr> <tr> <td>PHP 5.6.14</td> <td>818735</td> <td>5.63%</td> <td></td> <td>PHP 5.6</td> <td>3211919</td> <td>22.09%</td> </tr> <tr> <td>PHP 5.3.3</td> <td>669327</td> <td>4.60%</td> <td></td> <td>PHP 5.4</td> <td>2305984</td> <td>15.86%</td> </tr> <tr> <td>PHP 5.4.45</td> <td>573003</td> <td>3.94%</td> <td></td> <td>PHP 5.3</td> <td>1439061</td> <td>9.90%</td> </tr> <tr> <td>PHP 5.6.13</td> <td>492995</td> <td>3.39%</td> <td></td> <td>PHP 7.0</td> <td>169411</td> <td>1.17%</td> </tr> </table> <p>And here are pretty pies thanks to <a href="https://twitter.com/ashleyhindle/status/668807906972860416">Ashley Hindle</a> <img src="//seld.be/images/composer-2015.png" alt="" /></p> <p>A few observations: 5.3 lost 5% which is good but now I guess we are on a long tail decline of Ubuntu 12.04 machines, plus a lot of libs still test against it on Travis which might bias the numbers a bit. 5.5 is still the major platform with a stable 50%, and 5.6 adoption gained 15% that were lost by 5.4. We also see 7.0 appearing slowly, mostly I assume from travis builds again.</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 - November 2015 (+/- diff from November 2014)</h3> <table> <tbody><tr> <td style="width: 40px">5.2</td> <td style="width: 45px">1367</td> <td>2.78% (-0.8%)</td> </tr> <tr> <td>5.3</td> <td>25376</td> <td>51.69% (-16.17%)</td> </tr> <tr> <td>5.4</td> <td>16418</td> <td>33.45% (+7.04%)</td> </tr> <tr> <td>5.5</td> <td>5002</td> <td>10.19% (+8.18%)</td> </tr> <tr> <td>5.6</td> <td>826</td> <td>1.68% (+1.54%)</td> </tr> <tr> <td>7.0</td> <td>99</td> <td>0.2% (+0.2%)</td> </tr> </tbody></table> <p>A few observations: 5.3 lost quite a bit of ground but it seems to go to both 5.4 and 5.5. Given that 5.4 usage is going down quite a bit I think it's safe to go from 5.3 to 5.5 directly if you are going to bump the version requirement, or I'd even argue for 5.6 as it's usage is going up quite strongly and Ubuntu 16.04 should help that as well.</p> <p>I think php 7 should be required more as well as it comes with quite a few nifty features, I would say it is a good target for a new major version of any lib, but more on that in another post.</p> </div> <nav class="flex justify-between text-sm md:text-base"> <div> <a href="https://seld.be/notes/mysql-s-group-concat-limitations-and-cascading-bad-luck" title="Older Post: MySQL's GROUP_CONCAT limitations and cascading bad luck"> ← MySQL's GROUP_CONCAT limitations and cascading bad luck </a> </div> <div> <a href="https://seld.be/notes/new-composer-patterns" title="Newer Post: New Composer Patterns"> New Composer Patterns → </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 © 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>