An Web of PHP – Timo Tijhof
PHP is large. The trolls can proclaim its all-but-certain “demise” till the cows come house, however no quantity of heckling modifications that the Web runs on PHP. The proof is overwhelming. What follows is a loosely organised assortment of exactly that proof.
Statistics
PHP as programming language of alternative
From Language analysis by W3 Techs on the highest 10 million web sites worldwide:
- PHP at 77.2%.
- ASP at 6.9%.
- Ruby at 5.4%.
Content material administration on PHP
The majority of public websites construct on PHP through a CMS. By market share, 8 of the 12 largest CMS softwares are written in PHP. The under is from CMS usage by W3 Techs, the place every p.c represents 100,000 of the highest 10 million websites. There’s an identical CMS report by BuiltWith that analyses a bigger set of 78 million web sites.
- [PHP] WordPress ecosystem (63%)
- [Ruby] Shopify
- Wix
- Squarespace
- [PHP] Joomla ecosystem (3%)
- [PHP] Drupal ecosystem (2%)
- [PHP] Adobe Magento (2%)
- [PHP] PrestaShop (1%)
- [Python] Google Blogger
- [PHP] Bitrix (1%)
- [PHP] OpenCart (1%)
- [PHP] TYPO3 (1%)
E-commerce on PHP
From BuiltWith’s report on online stores, as of Aug 2023:
Anecdotes
Kinsta published a retort demonstrating that PHP is quick, full of life, and common:
Effectively, first off, it’s essential to level out that there’s a giant distinction between “wanting” and “being”. Folks have been calling for the demise of PHP […] way back to 2011.
PHP 7.3 was pushing 2-3x the variety of requests per second as PHP 5.6. And PHP 8.1 is even quicker.
[…] Due to PHP’s reputation, it’s simple to search out PHP builders. And never simply PHP builders – however PHP builders with expertise.
Matt Brown from Vimeo Engineering in It’s not legacy code — it’s PHP:
PHP hasn’t stopped innovating […]. A brand new wave of backend engineers deliberate how we would carve up 500,000 strains of PHP right into a bunch of [services]. […] Finally not one of the proposals took maintain.
Vimeo had grown many occasions over within the ten years since 2004, and our PHP codebase together with it […]
Ars Technica tells us: PHP maintains an enormous lead. Ars revealed a model of the W3 Techs report that features historic information.
Regardless of many notorious quirks, the server-side language appears right here to remain. […]Inside that dataset, the story instructed is evident. […] PHP held a 72.5 p.c share in 2010 and holds a 78.9 p.c share as of at this time. […] There doesn’t look like any clear contender for PHP to fret about.
Lex Fridman put it as follows in an interview with Python-creator Guido van Rossum on his podcast (episode, timestamp):
Lex: “PHP in all probability nonetheless runs a lot of the back-end of the Web.”
Guido: “Oh yeah, yeah. […]”
Daniel Stenberg’s annual Curl user survey (web page 18) asks the place individuals use curl. After curl’s personal interface (78.4%), essentially the most acquainted curl binding is PHP. It has been, because the survey’s starting in 2015. In 2023, 19.6% of curl survey respondents reported they use curl through PHP.
curl (CLI) 78.4%, php-curl 19.6%, pycurl 13%, […], node-libcurl 4.1%.
Ember.js famously originated from the Ruby neighborhood. However, as a frontend framework Ember can pair with any backend. The Ember Community Survey reviews PHP because the third-most favoured amongst survey individuals, after Ruby and Java.
The Ember survey additionally requested basic trade questions. For instance, 24% described their employer’s infrastructure as “self-hosted”, and never at a significant cloud supplier. This isn’t a consultant survey per-se, however should be a shock. Particularly for folk who depend on social media and convention talks for his or her sense of what companies do in the true world. It’s extra essential than ever for firms to have a cloud exit strategy prepared (NHS example). You’ll be able to learn how Basecamp’s cloud exit saves them tens of millions of {dollars} a 12 months.
PHP at scale
The stats cited above measure the variety of distinct websites and corporations. The overwhelming majority of these construct on PHP. However, all that claims about their scale is that they’re someplace within the prime 10 million. Does that fear you? What’s within the prime 500?
Jack Ellis from Fanthom Analytics in Does Laravel Scale? makes the case that you simply shouldn’t make selections primarily based on dealing with tens of millions of requests per second. You’re not more likely to attain that, and can face many different bottlenecks. However, it seems, PHP is without doubt one of the languages that does scale to that degree.
Once we began seeing unimaginable progress in our software program, Fathom Analytics (which is constructed on Laravel), […] by no means had moments of “does the framework do sufficient requests per second?”. […]
I’ve labored with enterprise firms utilizing Laravel to energy their complete enterprise, and corporations reminiscent of Twitch, Disney, New York Instances, WWE and Warner Bros are utilizing Laravel for varied tasks they run. Laravel can deal with your utility at scale.
Matt Brown once more, from Vimeo Engineering in It’s not legacy code:
I’m right here to let you know that it could actually, and Vimeo’s continued success with PHP is proof that it’s an excellent instrument for fast-moving firms in 2020.
Vimeo is also referred to as the developer of Psalm, a preferred open-source static evaluation instrument for PHP.
From Keith Adams, Chief Architect at Slack Engineering in Taking PHP Seriously:
Slack makes use of PHP for many of its server-side utility logic […].
some great benefits of the PHP surroundings (lowered price of bugs by means of fault isolation; protected concurrency; and excessive developer throughput) are extra invaluable than the issues […]
Let’s take one other take a look at the W3 Techs report, and this time concentrate on the dimensions of some single companies. On the prime, now we have WordPress which in fact powers Automattic’s WordPress.com. That’s 20 billion web page views each month (Alexa rank 55 worldwide).
If we transfer additional down the report, to entries with 0.1% market share, we discover PHP programs that energy huge web sites. But, these are additionally the platform of alternative for over 100,000 smaller web sites.
MediaWiki is the platform behind Wikipedia.org with 25 billion page views a month (Alexa #12). MediaWiki additionally powers Fandom with 2 billion page views a month (Similarweb #44), and WikiHow with 100 million month-to-month guests (Alexa #215).
Different main Web properties powered by PHP embody Fb (Alexa #7), Etsy (Alexa #66), Vimeo (Alexa #165), and Slack (Similarweb #362).
Etsy is fascinating attributable to its excessive proportion of lively periods and dynamic content material. This not like Wikipedia or WordPress, which might serve most web page views from a static cache. This implies regardless of an identical scale, Etsy’s PHP utility is much more uncovered to their high traffic.
Etsy can also be the place PHP-creator Rasmus Lerdorf is employed. He generally options snippets from Etsy’s codebase in his tech talks. (Geek aspect notice: His 2021 Modern PHP talk explains how Etsy deploys with rsync
, precisely like Wikipedia did for the previous decade with Scap). Etsy’s engineering weblog often covers work on their modular PHP monolith, e.g. Plural localisation, or their detailed Etsy Site Performance reviews:
Fortunately, this quarter we noticed site-wide efficiency enhancements, attributable to our improve to PHP7.
[…] we noticed vital efficiency good points on all our pages.
What about my bubble?
One might critique the PHP neighborhood for not occupying a lot area in public discourse. Whether or not PHP core builders, or authors of PHP packages (like Laravel, Symfony, WordPress, Composer, and PHPUnit), or the common engineer utilizing it of their day job… we’re not seen a lot in arguments on social media.
You additionally don’t see us give many convention talks prescribing formulation for a stack that can “undoubtedly be higher” on your firm. If talks by followers of sure JavaScript frameworks are something to go by, we should always imagine that almost all firms use their stack at this time, and that you need to really feel sorry in case you nonetheless don’t. I don’t say that to evaluate JavaScript. What bothers me is prescriptive messaging with out contemplating technical or enterprise wants, with out assessing what “higher” means — higher in comparison with what? It’s exhausting to match the one factor you already know.
The above isn’t to say JavaScript doesn’t have its place. Share your expertise! Share your outcomes (and the benchmarks behind them), what labored, what didn’t. Maintain looking out, preserve innovating, preserve sharing, and above all: preserve pushing the human race ahead. That’s free software!
One might query deserves by means of the lost decade and critique on React, however… React holds a 3% market share. Add the smaller frameworks (Vue, Angular, Svelte) and we attain a sum of 5%. Equally, Node.js as net server holds 3% market share. Does that imply over 90% missed out on This One Trick That Will Increase Your Enterprise?
Lest we overlook, this 5% represents 500,000 main web sites. That’s enormous. Node.js has its place and its strengths (real-time message streams). However, Node.js additionally has its weaknesses (blocking the main thread). And keep in mind, market share doesn’t say a lot about scale. It might be powering a number of organisations within the prime 1% (like MediaWiki), or the underside 1%. Or, be WordPress and energy each the highest 1% and over 40 million different websites.
Conclusion
Firms younger and outdated, small and massive, won’t be utilising the software program stacks we hear talked about most in public areas. That is very true outdoors the bubble of private tasks and cash-burning startups.
Is PHP the most financial alternative for rising and sustained companies at this time? Is it within the prime three? Does language runtime matter in any respect when scaling up a enterprise and crew of individuals round it? We don’t know.
What we do know is that an excellent many companies at this time construct on PHP, and PHP has confirmed to be a sustainable possibility. It stood the take a look at of time. That features new firms like Fathom that turned profitable in simply three years. Just like the Fathom article stated, most of us won’t ever attain that scale. However, it’s comforting to know that PHP is a sustainable and economical possibility even at scale. Is it the one possibility? No, actually not.
There are languages which are even quicker (Rust), have an excellent bigger neighborhood (Node.js), or have extra mature compilers (Java); however that tends to commerce different values.
PHP hits a sure Goldilocks sweetspot. It’s fairly quick, has a large community for productivity, options modern syntax, is actively developed, simple to study, simple to scale, and has a big customary library. It affords excessive and protected concurrency at scale, but with out async complexity or blocking a principal thread. It additionally tends to hold low upkeep price attributable to a steady platform, and thru a neighborhood that values compatibility and low dependency count. You should have completely different wants at occasions, in fact, however for this specific sweetspot, PHP stands amongst only a few others. Which others? You inform me!
Additional studying
- Choose Boring Technology, Dan McKinley, 2015.
- The Simple Joys of Scaling Up, Jordan Tigani, 2023.
- How to protect yourself from npm, Timo Tijhof, 2019.
- We’re drowning in software dependencies, Ryan Barrett, 2022.
- “Out of the Software Crisis”: Dependencies, Baldur Bjarnason.
- Squeeze the hell out of the system you have, Dan Slimmon, 2023.
- On language choice and maintenance burden at Wikimedia, Tim Starling, 2018.
Replace (6 Sep 2023): Concerning HHVM, Wikipedia and Etsy certainly each tried it as PHP5-compatible different runtime (no Hacklang). After performance improvements in PHP 7, Wikipedia reverted its roll out and upgraded to PHP 7.2. Etsy additionally deserted the experiment and partial use and equally moved to PHP 7, stating later: “hhvm was a catalyst for efficiency enhancements that made it into PHP7. We are actually fully converted to PHP7 all over the place“.