<?xml version="1.0"?>
<?xml-stylesheet href="/transform" type="text/xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bs="http://purl.org/ontology/bibo/status/" xmlns:ci="https://vocab.methodandstructure.com/content-inventory#" xmlns:dct="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" lang="en" prefix="bibo: http://purl.org/ontology/bibo/ bs: http://purl.org/ontology/bibo/status/ ci: https://vocab.methodandstructure.com/content-inventory# dct: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# xhv: http://www.w3.org/1999/xhtml/vocab# xsd: http://www.w3.org/2001/XMLSchema#" vocab="http://www.w3.org/1999/xhtml/vocab#" xml:lang="en">
  <head>
    <title property="dct:title">The Only Argument You Will Ever Need Against PHP</title>
    <base href="https://doriantaylor.com/the-only-argument-you-will-ever-need-against-php"/>
    <link href="document-stats#EkBJLi5A8Ild_31mPR0tyJ" rev="ci:document"/>
    <link href="elsewhere" rel="alternate bookmark" title="Elsewhere"/>
    <link href="this-site" rel="alternate index" title="This Site"/>
    <link href="http://purl.org/ontology/bibo/status/published" rel="bibo:status"/>
    <link href="" rel="ci:canonical" title="The Only Argument You Will Ever Need Against PHP"/>
    <link href="lexicon/#EzqXIsriaILFcWjXdS7FbI" rel="dct:audience" title="Software Developer"/>
    <link href="person/dorian-taylor#me" rel="dct:creator" title="Dorian Taylor"/>
    <link href="person/dorian-taylor" rel="meta" title="Who I Am"/>
    <link about="./" href="3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="./" href="f07f5044-01bc-472d-9079-9b07771b731c" rel="alternate" type="application/atom+xml"/>
    <link about="./" href="this-site" rel="alternate"/>
    <link about="./" href="elsewhere" rel="alternate"/>
    <link about="./" href="e341ca62-0387-4cea-b69a-cdabc7656871" rel="alternate" type="application/atom+xml"/>
    <link about="verso/" href="3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="verso/" href="this-site" rel="alternate"/>
    <link about="verso/" href="elsewhere" rel="alternate"/>
    <meta content="the-only-argument-you-will-ever-need-against-php" datatype="xsd:token" property="ci:canonical-slug"/>
    <meta content="It doesn't even involve aesthetics." name="description" property="dct:abstract"/>
    <meta content="2018-04-18T22:52:05+00:00" datatype="xsd:dateTime" property="dct:created"/>
    <meta content="the-only-argument-you-will-ever-need-against-php" property="dct:identifier"/>
    <meta content="2018-04-18T22:55:22+00:00" datatype="xsd:dateTime" property="dct:issued"/>
    <meta content="2018-05-29T18:17:33+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T15:10:50+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta about="person/dorian-taylor#me" content="Dorian Taylor" name="author" property="foaf:name"/>
    <meta content="summary" name="twitter:card"/>
    <meta content="@doriantaylor" name="twitter:site"/>
    <meta content="The Only Argument You Will Ever Need Against PHP" name="twitter:title"/>
    <meta content="It doesn't even involve aesthetics." name="twitter:description"/>
    <object>
      <nav>
        <ul>
          <li>
            <a href="programming-languages-i-have-known-and-loved-loathed-lulzed" rev="dct:references" typeof="bibo:Article">
              <span property="dct:title">Programming Languages I Have Known and Loved/Loathed/Lulzed</span>
            </a>
          </li>
          <li>
            <a href="document-stats#EkBJLi5A8Ild_31mPR0tyJ" rev="ci:document" typeof="qb:Observation">
              <span>urn:uuid:90124b8b-903c-4225-977f-df598f474b72</span>
            </a>
          </li>
        </ul>
      </nav>
    </object>
  </head>
  <body about="" id="EWFmsy3V3Sr4E5s_7PEtSK" typeof="bibo:Article">
    <p>I will begin by disclosing that I have never used <abbr>PHP</abbr> on a project, because I have never needed to. By the time <abbr>PHP</abbr> had its breakout moment, I had moved on from making Web apps to making infrastructure, and in 20 years, I've never encountered a situation in which I needed something <abbr>PHP</abbr> does <span class="parenthesis" title="Meaning that, if I had cut my teeth on PHP and not something else, I would have used it, and if I had come into this business any later, I probably would have cut my teeth on PHP.">that something else didn't.</span></p>
    <p>I nevertheless have thousands of hours of <abbr>PHP</abbr> experience, from mopping up some hacked or otherwise messed up doo-dad or other, because the person who put it there <em>couldn't</em>.</p>
    <aside role="note" id="E4OUdZ265BDP3h9j2gxBNL">
      <p>This phenomenon usually manifests as an installation of WordPress, Drupal, MediaWiki, etc., and on down the list of lesser-known <span class="parenthesis" title="or CRM or wiki or message board or whatever"><abbr title="content management system">CMS</abbr> products</span> <span class="parenthesis" title="IMAP front-ends like SquirrelMail, management interfaces like PHPMyAdmin, kitchen sinks like OwnCloud">and related utilities</span>. Often comes in multiples. Occasionally it is something home-grown.</p>
    </aside>
    <p>I feel injured by this. I feel robbed. This kind of <em>expertise arbitrage</em>, where the skill level you need to set something up initially is nowhere near the skill level you need to fix it when it breaks, is pervasive in the software industry, and will continue to pervade as long as there are libraries, frameworks, and high-level languages. This not a problem unique to <abbr>PHP</abbr>, though I <em>do</em> believe the gap in <abbr>PHP</abbr> is characteristically wide.</p>
    <p>Anyway, that's not even the main argument. This is:</p>
    <p>The reason why <abbr>PHP</abbr> is so popular is because second to JavaScript, you couldn't ask for an easier introduction to programming. Why? Because you type in the code and you upload the file and you load the webpage in your browser and you see what you just made go and it's amazing. Oh, and <em>other people can see it too.</em> Instant gratification. It's also free, it's batteries-included, and for two decades you've been able to find <span class="parenthesis" title="Furthermore, since after all it is PHP, you'd almost never need to pay for anything more sophisticated.">dirt-cheap shared hosting that carries it at no extra charge.</span></p>
    <p>This business of <q>upload the file and it just runs</q> is central to my beef with <abbr>PHP</abbr>. My aforementioned thousands of hours of mopping are almost uniquely attributable to this feature. If an attacker can smuggle a <abbr>PHP</abbr> file <span class="parenthesis" title="or anywhere else they can address it">onto your document root</span>, then they can execute it. If they can do <em>that</em>, then they own you. This attack vector cannot be eliminated. If you use <abbr>PHP</abbr>, you will always be fighting it. <em>Forever</em>.</p>
    <aside role="note" id="EdmV4axenA6hpbSFV3a2wL">
      <p>Once again, this situation is not unique to <abbr>PHP</abbr>, it's just that <abbr>PHP</abbr> is where you're most likely to see it. This issue also isn't strictly about document roots, but more about the level of control over what code gets executed. It's the difference between a default-deny policy and default-allow.</p>
    </aside>
    <p>I suppose this is where Hacker News cruises in on a hoverboard and tut-tuts at me, between jets of vape steam, that well actually, <abbr>PHP</abbr> web apps can be made to run outside the document root just like anything else, and indeed this is how modern <abbr title="model-view-controller">MVC</abbr> frameworks operate. Sure they can, but then you obviate the point of using it. If you aren't going to be plunking files into your document root for immediate execution, you may as well use <span class="parenthesis" title="literally any">some</span> other stack.</p>
    <p>Well, there may be one other reason. <abbr>PHP</abbr> apologists like to gloat that unlike more esoteric programming languages, they always have plenty of job opportunities. <q>What do you call a <abbr>PHP</abbr> developer? Employed.</q> What kind of jobs though? Mopping-up jobs, of course. Moreover, on the other side of that job is an employer, who is more than happy to take advantage of all this competition. If you aren't working at Facebook, the Wikimedia Foundation, Automattic or Acquia, it's probably worth asking yourself, dear <abbr>PHP</abbr> developer, if you are being played.</p>
    <p><abbr>PHP</abbr> made a heck of a lot of sense <span class="parenthesis" title="prior to 3.0 it was an even bigger mess">in 1998</span>. In 2018, when you can throw literally anything into a container and run it on a cloud instance that costs less than the shared hosting account did, the unique value proposition of <abbr>PHP</abbr> isn't as clear. Even as a first language: <span class="parenthesis" title="it arguably never gave it up">that crown has been taken by JavaScript</span>.</p>
    <p>Expertise arbitrage, though, irrespective of its substrate, <span class="parenthesis" title="Facebook would have siezed up if it didn't effectively warp reality so it could keep using PHP.">is very real and very much a liability.</span> This to me makes one's choice of <q>stack</q> more than just a matter of taste: it's an object of organizational design.</p>
    <p>And if that isn't good enough, I can tell you from experience that banning <abbr>PHP</abbr> within your organization will eliminate aeons of monotonous tweezing out of Russian dick-pill spam. It's up to you.</p>
  </body>
</html>
