15 votes

An Internet of PHP

4 comments

  1. [2]
    Hazel
    Link
    I'm rather skeptical of that 77% mark. W3Techs, BuiltWith and similar sites all have one major flaw: they only include sites "whose server-side programming language we know". That's obviously hard...

    I'm rather skeptical of that 77% mark. W3Techs, BuiltWith and similar sites all have one major flaw: they only include sites "whose server-side programming language we know". That's obviously hard to avoid, but it will significantly skew the results when a lot of major PHP applications are incredibly "loud" about what they are. It's really hard to masquerade WordPress as being something else. PHP itself is also fairly loud, with expose_php being turned on by default and sending an X-Powered-By: PHP/x.y.z header.

    For a reproducible example, both W3Techs and BuiltWith fail to identify Tildes as being built on Python. Likewise, the site for Python's Django framework is not currently identified as Python or Django (despite publicly available source code showing it is), it only manages to find the Discourse/Ruby forum and some mentions of the former Trac/Python install.

    Going through 7 non-PHP sites I've worked on in some capacity, none of them are identified correctly; not even the relatively obvious Python+Django one that has a few mentions of it in its HTML. The 4 PHP sites I've worked on are all identified as PHP, though one is incorrectly identified as being WordPress (it's custom spaghetti stemming from 200x).

    I don't have better numbers, I don't think those numbers can exist. But it's obvious that these are junk.

    21 votes
    1. Minty
      Link Parent
      Perhaps a better way would be to identify some Github repositories of websites and website frameworks, and check those. Along with the sites running on these frameworks of course. This would still...

      Perhaps a better way would be to identify some Github repositories of websites and website frameworks, and check those. Along with the sites running on these frameworks of course. This would still be significantly biased, but at least in a more transparent and manageable way.

      1 vote
  2. lux
    Link
    Honestly, I don't really see a "sweet spot" in PHP. PHP is widely used because of Wordpress, existing CMSs like Typo and Joomla and E-Commerce applications. Those are applications you deploy to...
    • Exemplary

    Honestly, I don't really see a "sweet spot" in PHP.

    PHP is widely used because of Wordpress, existing CMSs like Typo and Joomla and E-Commerce applications. Those are applications you deploy to your server and and modify it. Simple as that.

    I haven't met anyone in the last five to eight years even mentioning PHP in any regard for developing new services. It's so disregarded that no one even thinks about it anymore. In my career I write new applications and have rarely modified existing software, as I was usually contracted to solve individual problems and never created themes or plugins for Wordpress blogs or similar things.

    The usual choices are C#/Rust/Go/Node.js sometimes Java in my experience.

    10 years ago I wrote most of the sites in PHP. Primarily I really liked Laravel because of the nice abstraction it brought and it was very lightweight.

    The only upsides PHP has is:

    • Ease of deployment (You can move those apps via FTP to any webhoster and are ready to go)
    • Ease of writing (Simple and easy to understand)

    The stdlib of PHP and its syntax was awful, something that only has been fixed in the recent major versions, parts of the stdlib is still very C-ish which should not be the case in a high level web application imo and the behaviors/arguments/return values of functions are inconsistent.

    This is my personal opinion of course. It's still a working language and if someone is comfortable with it, that's totally fine. I see no point in having language wars of any kind. It's just a tool like any other language is.

    However, I don't see much reason in articles like these where it's like "Ha, Gotcha its still used the most".
    Technically it is, but not because of PHP itself, but because a lot of web apps were written in PHP ages ago and were not rewritten because they work fine enough. I would argue that PHPs current web influence is living solely on the past devs decisions and success, and not because of todays capabilities.

    I would argue that new software similar to Wordpress or Joomla would not be written in PHP anymore.
    And I think that's mostly the argument the "opposition" makes.

    The article feels like it's trying to come up with any kind of argument to support the claim.

    For example the curl section. Of course curl bindings are mostly used from the PHP side, because the HTTP request API was awful.
    When I was working with PHP, there was simply no other real and proper alternative to it. In C#/Node.js and honestly, any other common language, web requests simply do not require curl in any way because they provide those in the stdlib already.

    Slacks arguments are interesting as well "fault isolation; safe concurrency; and high developer throughput" what does that even mean in PHPs context? It's nothing where PHP is standing out in any way.

    It kind of comes down to "PHP devs are cheaper, and it's simple to write".

    Why would an experienced dev today prefer PHP instead of the various other languages?

    PHP hits a certain Goldilocks sweetspot. It is pretty fast, has a large community for productivity, features modern syntax, is actively developed, easy to learn, easy to scale, and has a large standard library.

    This is such a non-argument that I don't even know where to start countering it.

    If PHP works fine for you that's totally awesome, go build amazing stuff with it!
    But at least in the professional sector I work in, call it "my bubble" it's out of anyones mind for a very long time for a lot of reasons.
    It does not provide any "sweet spot" we could benefit from really.

    11 votes
  3. Amun
    Link
    Timo Tijhof

    Timo Tijhof


    PHP is big. The trolls can proclaim its all-but-certain “death” until the cows come home, but no amount of heckling changes that the Internet runs on PHP. The evidence is overwhelming.

    From Language analysis by W3 Techs on the top 10 million websites worldwide:

    • PHP at 77.2%.
    • ASP at 6.9%.
    • Ruby at 5.4%.

    The bulk of public sites build on PHP via a CMS. By market share, 8 of the 12 largest CMS softwares are written in PHP.

    From BuiltWith’s report on online stores, as of Aug 2023:

    • WooCommerce for WordPress (24% of global market share)
    • Adobe Magento (7% of global market share)
    • OpenCart (2% global market share, 24% market share in Russia)
    • PrestaShop (2% global market share, 14% market share in France)

    Kinsta published a retort demonstrating that PHP is fast, lively, and popular:

    Well, first off, it’s important to point out that there’s a big difference between “wanting” and “being”. People have been calling for the death of PHP […] as far back as 2011.

    PHP 7.3 was pushing 2-3x the number of requests per second as PHP 5.6. And PHP 8.1 is even faster.

    […] Because of PHP’s popularity, it’s easy to find PHP developers. And not just PHP developers – but PHP developers with experience.

    Matt Brown from Vimeo Engineering in It’s not legacy code — it’s PHP:

    PHP hasn’t stopped innovating […]. A new wave of backend engineers planned how we might carve up 500,000 lines of PHP into a bunch of [services]. […] Ultimately none of the proposals took hold.

    Vimeo had grown many times over in the ten years since 2004, and our PHP codebase along with it […]

    Ars Technica tells us: PHP maintains an enormous lead.

    Despite many infamous quirks, the server-side language seems here to stay. […]

    Lex Fridman put it as follows in an interview with Python-creator Guido van Rossum on his podcast (episode, timestamp):

    Lex: “PHP probably still runs most of the back-end of the Internet.”
    Guido: “Oh yeah, yeah. […]”

    Jack Ellis from Fanthom Analytics in Does Laravel Scale? makes the case that you shouldn’t make choices based on handling millions of requests per second. You’re not likely to reach that, and will face many other bottlenecks. But, it turns out, PHP is one of the languages that does scale to that level.

    Let’s take another look at the W3 Techs report, and this time focus on the size of some single businesses. At the top, we have WordPress which of course powers Automattic’s WordPress.com. That’s 20 billion page views each month (Alexa rank 55 worldwide).

    MediaWiki is the platform behind Wikipedia.org with 25 billion page views a month (Alexa #12). MediaWiki also powers Fandom with 2 billion page views a month (Similarweb #44), and WikiHow with 100 million monthly visitors (Alexa #215).

    Other major Internet properties powered by PHP include Facebook (Alexa #7), Etsy (Alexa #66), Vimeo (Alexa #165), and Slack (Similarweb #362).

    Etsy is interesting due to its high proportion of active sessions and dynamic content. This unlike Wikipedia or WordPress, which can serve most page views from a static cache. This means despite a similar scale, Etsy’s PHP application is a lot more exposed to their high traffic.

    Etsy is also where PHP-creator Rasmus Lerdorf is employed. He sometimes features snippets from Etsy’s codebase in his tech talks. (Geek side note: His 2021 Modern PHP talk explains how Etsy deploys with rsync, exactly like Wikipedia did for the past decade with Scap).

    One could critique the PHP community for not occupying much space in public discourse. Whether PHP core developers, or authors of PHP packages (like Laravel, Symfony, WordPress, Composer, and PHPUnit), or the average engineer using it in their day job… we’re not seen much in arguments on social media.

    You also don’t see us give many conference talks prescribing formulas for a stack that will “definitely be better” for your company.

    What we do know is that a great many businesses today build on PHP, and PHP has proven to be a sustainable option. It stood the test of time.

    There are languages that are even faster (Rust), have an even larger community (Node.js), or have more mature compilers (Java); but that tends to trade other values.

    PHP hits a certain Goldilocks sweetspot. It is pretty fast, has a large community for productivity, features modern syntax, is actively developed, easy to learn, easy to scale, and has a large standard library.

    It offers high and safe concurrency at scale, yet without async complexity or blocking a main thread. It also tends to carry low maintenance cost due to a stable platform, and through a community that values compatibility and low dependency count.

    You will have different needs at times, of course, but for this particular sweetspot, PHP stands among very few others. Which others? You tell me!

    6 votes