Source.

Yep, PHP is turning 30 this year! Wondering if “PHP is still relevant?” Ever since we have been hearing that PHP is dead. It was “dead” 10 years ago, 5 years ago, and “is dead” today. But somehow - it isn’t. Anyway… happy birthday!

  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    14 days ago

    this is perl erasure

    also php didn’t cause the internet to suck; overreliance on javascript (and js based frameworks) did. there’s a reason that modern internet is so slow and clunky and it’s not php. at least php has the capabibility to improve over time not degrade.

  • BlameTheAntifa@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    In PHPs defense, it keeps evolving in positive, meaningful ways. If you are up to date with it, it’s quite sophisticated and enjoyable. Doubly so if you use a framework like Laravel.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      15 days ago

      Yeah, if you add tons of extra rules and tools, it can become almost as pleasant as the main Python or Ruby experience.

      Almost.

    • mad_lentil@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      14 days ago

      Yeah last time I used it was with a laravel monolith and actually it wasn’t that bad.

    • SavinDWhales@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      14 days ago

      PHP 8.4 is pretty good, TBH. You absolutely CAN write great code with modern PHP. … Shame that most PHP I touch is legacy code that’s at MOST PHP 7.4 - which is EOL since November '22 and has to be upgraded or replaced. 😬

    • mriswith@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      15 days ago

      Most memes referencing a direct problem in PHP, are old or made by people who haven’t touched the language in a decade(version 7 was in 2015, and it removed/fixed a lot of issues and added needed features).

      • Scrollone@feddit.it
        link
        fedilink
        arrow-up
        0
        ·
        14 days ago

        Also, most of the websites are made with WordPress, which… take a guess, yes, it runs on PHP!

        (even though WordPress is a bad example because it’s written in a horrible and ancient way)

    • Lovable Sidekick@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      I agree. A lot of people who mock PHP know almost nothing about it but they know they’re supposed to hate it because all the cool kids do.

    • Lovable Sidekick@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      Or TSP (trisodium phosphate) - which you can’t even make websites with, but it’s great for cleaning oil spots off the driveway.

      • PolarKraken@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        14 days ago

        Well, now, that’s useful, but we shouldn’t fail to mention good ol HCl, muriatic acid colloquially for this purpose, also great for cleaning oil stains from a driveway!

      • Lenggo@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        15 days ago

        I laughed pretty hard at this while also unexpectedly learning how to clean up a mess I made changing the oil in my car on a particularly windy day recently!

  • leds@feddit.dk
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    Maybe 25 years ago i build my first website for a paying customer ( my dad). I decided to go for php which was new to me at the time.

    I figured it would be too risky ( even back then) to have PHP generate dynamic pages so instead I had php generate static html.

    So whenever website needed updating , for example a new folder with images was added, you could just load the admin.php and it would generate gallery pages for you.

    Would probably still work 25 year later if wasn’t eventually replaced with some WordPress or something

  • josefo@leminal.space
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    It’s true that the fuckers that stayed in PHP now are getting paid insane amounts of money to maintain systems? I’ve heard they are the new cobol people.

    • Lovable Sidekick@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      15 days ago

      I doubt that the pay is insane yet. There are a lot more PHP devs than COBOL devs. About half of the web still runs on PHP. It’s true that COBOL runs about half of the financial world, but PHP is less than 30 years old whereas COBOL programs are relics from decades earlier, and generally only get updated minimally if the systems around them change.

  • Decq@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    15 days ago

    Let’s be honest though. The early PHP version were absolute dog shit. And the definition of how not to design a programming language. That said, that never stopped anyone in web development from using it apparently. No clue what modern PHP looks like, apparently it’s better now.

    • kingofras@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      15 days ago

      Was not intended as programming language. The name literally stands for Hypertext PreProcessor. It was meant to be a script injector for HTML back when the internet was still fun.

      Then it got out of hand and PHP didn’t evolve fast enough to be a web technology leader, but never ceded the position of old trusty workhorse, and still powers a significant part of websites.

      • Decq@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        15 days ago

        I somewhat know the history of PHP and how it came to be. And that it was just a personal project that suddenly got big. So I don’t blame the creator. But that still doesn’t make it a good language.

      • kernelle@0d.gs
        link
        fedilink
        arrow-up
        0
        ·
        15 days ago

        OOP programming in PHP is pretty fun, keeping up with it’s deprecations and vulnerabilities is not

    • thesystemisdown@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      Modern PHP is better because it’s modern. Which early version of a programming language was good? I’ve used a lot of them, and by modern standards, I think dog shit is a somewhat appropriate description for most of them.

      • azertyfun@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        15 days ago

        It’s one of a plethora of scripting languages from the '90s which were designed to be the antithesis of “fail fast” and kept going no matter what.

        I guess what with C/C++ being the Mainstream Option at the time, not having to deal with a strict compiler must have felt like freedom. As someone who has had to maintain, cleanup and migrate ancient PHP code, I call it folly. That mindset of “let the programmer just do whatever and keep trucking” breeds awful programming practices and renders static analysis varying degrees of useless, which makes large-scale refactoring hard to automate which is just amazing when your major versions aren’t even remotely FUCKING BACKWARDS COMPATIBLE.

        PHP’s original design is just fundamentally atrocious. It became popular in large part because unmaintainable code is usually someone else’s problem.

        A language that I would definitely use for server-side rendering and that was already good from its first stable release is Go. It was thoughtfully designed and lends itself really well to static analysis, while still being easy to write and decently performant.

      • Decq@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        15 days ago

        It’s been about 20 years since I’ve touched PHP. So i don’t remember all the problems i had with it.

        But some language from those times were at least consistent with itself and clearly more thought-out. Even though they might miss some of the nicety we’ve come to like nowadays. Of course for web development there weren’t many better choices back then.

        But I’m heavily skewed towards non-oo, static typed, explicit languages so PHP was probably never for me.

    • friend_of_satan@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      15 days ago

      IMHO the killer feature was mod_php. Writing server-side website logic was stupid easy with that. I think if it weren’t for that, php wouldn’t have been nearly as popular.

      I quit using it like 10 years ago, but I’m happy with what I did with it and got from it.

    • nilloc@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      When I was using Ruby (some Rails, but mostly Sinatra, for little web apps and api serving) Laravel was coming up in PHP shops. Which was just trying to be Rails running on PHP from what I could tell.

      There were others before that, like CakePHP, but all I remember about that of all the bugs my coworkers dealt with. I was strictly a front end dev back then.

  • simonced@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    14 days ago

    Array_filter and array_map having the arguments swapped pisses me of so much.!

  • merc@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    Where I live, I still see people in a horse-drawn wagon. So, I guess horse-drawn wagons never died? It’s only used for tourists and weddings, but that counts, right?

    According to Tiobe, PHP was the programming language of the year in 2004. In 2010 it was number 3 in the top 10 programming languages. It’s now out of the top 10 entirely. There really isn’t a language that has completely disappeared. Mainframes are still programmed using COBOL, Scientists are still using FORTRAN, even Lisp, which has been around since the 1950s, is still going strong.

    Maybe Actionscript counts as truly dead, since it was tied to Adobe Flash, and Flash is truly dead?

    I have a lot of bad memories of PHP. It was, for a brief time, the main language I used, but it was so ugly and inconsistent. The only thing I loved about it, at the time, was that it wasn’t Visual Basic. As bad as PHP was, at least I wasn’t making web pages in that pile of hot garbage. But, I never felt joy writing something in PHP. At best it was a slog. At worst it was like pulling teeth.

    Just about every other language has given me moments of fun. Original Javascript was a mess, but it already contained scheme-like features. It was sold as being an interpreted version of Java, but it had features that Java wouldn’t have for at least a decade. C is a brutal and unforgiving language, but as long as you’re not working with strings, it’s great to have such low-level control over everything.

    Maybe PHP has evolved like other languages, but I still am not interested in trying it out. Everything it was good at can be done better by other languages, and those are languages that give me joy, not pain. I hope it keeps dropping in the rankings so that people aren’t exposed to it as one of their first languages.

    • dlb@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      15 days ago

      I wouldn’t even say that Flash is truly dead, thanks to emulators like Ruffle. You can still make a movie or game in Flash MX 2004, which is freely available now, and have it run in the browser. That said, last I looked (years ago) only AS2 was supported, so AS3 might be well and truly dead (rip my first language).

    • PumaStoleMyBluff@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      14 days ago

      There are still Amish and Mennonite communities who use horse-drawn wagons and farm implements their whole lives.

      Not really meant to be an argument to your point, just interesting to know.

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      14 days ago

      There really isn’t a language that has completely disappeared.

      How about that shit where a “program” was a bunch of patch cables plugged into various sockets? That shit is gone, man.

      • lad@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        14 days ago

        Just for the sake of being contrary, I know that there are still machines running on punch cards in some army-related places, where not changing anything is mandatory. I wouldn’t be surprised if hot-wiring is also still there somewhere, it’s just mostly running without changes.

        • ChickenLadyLovesLife@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          14 days ago

          The original Moog synthesizers used patch cords (in fact that’s why a synthesizer instrument sound is still called a “patch”) and I’m sure somebody somewhere is still fucking around with one of those.

    • ByteOnBikes@discuss.online
      link
      fedilink
      arrow-up
      0
      ·
      15 days ago

      Laravel brought life back to PHP for me. It’s elegant. I feels like speaking.

      And PHP 8 is light-years away from the garbage I grew up on.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        15 days ago

        I took a look and threw up in my mouth a little. That’s not how backslashes should be used.

        Instead of writing their frontend templates in PHP via Blade, many developers have begun to prefer to write their templates using React or Vue.

        So… the only thing that PHP is really good for should be replaced by React or Vue Javascript / Typescript?

        To each their own, but for me that’s a no.

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            0
            ·
            14 days ago

            I just looked, that was the basis of my comment. It’s bad, in particular that “Laravel” thing was awful.

    • kameecoding@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      14 days ago

      Yeah, I think this is a more fitting meme to be about Java, because despite all the java is dead articles it’s still like one of the top most used language, if anything is a serious backend service it likely runs on Java.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        14 days ago

        Java is a better fit. It hasn’t fallen in popularity the way PHP has. But, I’m not convinced that serious backend services mostly use Java. It’s one of the languages used, sure. But, I don’t know if it beats C/C++ or Go. Apache’s C. Nginx is C. Kubernetes is Go. Docker is Go.

        I think Java has a niche with certain kinds of business logic applications, and those are pretty common. I would guess that in a typical set of interactions with a Google product, or a Meta product, or an AWS product, some parts of the traffic will be handled by services written in Java. But, others will be C/C++ or Go. There will probably also be some parts of the process that are PHP or Ruby or Python, and a lot of Javascript.

        • kameecoding@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          14 days ago

          I can only speak for what I see in the central European market, big banks like Unicredit (literally primefaces frontend), Erste group is running Java, basically all government services are Java.

          Java is by far the dominant language on the job market in terms of number of open positions and salary.

        • cute_noker@feddit.dk
          link
          fedilink
          arrow-up
          0
          ·
          14 days ago

          Most developers are not going to create the next kubernetes. For me it is usually down to earth integrations. Take this file from s3, send as email and sftp here. Create API to proxy another API. Take messages from Kafka, put on rabbitMQ. Save messages from rabbitMQ to database.

          I think Java is very strong with libraries. Especially with Spring Boot and camel. I don’t really see it as niche but more of a plain boring peanut butter sandwich. Boring. Unexciting. But works.

          I am however trying to convince my boss to allow kotlin. Which has access to all the java libraries

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            0
            ·
            14 days ago

            Most developers are also not going to create a “serious backend service”. Most are making a random website, or chaining together a few “business logic” items. I think we’re just talking about different levels of “serious backend service”. Like, if you mean someone making a website for the biggest industrial machinery company in the fortune 500, but it’s all B2B stuff and so it handles at most hundreds of QPS, then I think you’ll find a lot of Java there. I just think that for the biggest B2C companies in the world that handle hundreds of thousands of QPS, it’s not exclusively Java.

            I’m not trying to say Java is bad or anything. It’s just that it has a few quirks (like garbage collection) that start to matter when you’re getting eye-watering levels of traffic. So, for the most serious of the “serious backend services” I think you see Java, but you also sometimes see C/C++ and Go.

            • cute_noker@feddit.dk
              link
              fedilink
              arrow-up
              0
              ·
              14 days ago

              What if those chains handle thousands of massages per second?

              Serious backend is indeed a stretchy term. And I agree with that point b2b java is common. But our b2b backend handles multiple thousands of massages per second. I find the bottleneck to be MySQL and RabbitMQ.

              I think it makes sense for a serious backend to have load balancing and nginx cache and horizontal scaling. I reckon QPS doesn’t matter as much as you think it does.

              I still don’t think that java would be considered niche. I rather think that C or C++ would be considered niche. It takes longer to develop, and is not memory safe so I don’t think that most backend systems should consider it.

        • bestboyfriendintheworld@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          11 days ago

          Java has been running serious server software since the mid 1990s. Think WebObjects running on Solaris. Lots of business stuff with big databases still run infrastructure like that.

          Java still has the big advantage of being machine agnostic. No need to recompile for ARM or Intel.

  • 0x01@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    Magic quotes were the single biggest mistake I’ve ever seen any language standard make.

    • Scrollone@feddit.it
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      14 days ago

      But let’s not forget that the WordPress codebase is absolute dogshit.

      And not an example of how to write proper modern PHP.

  • Lovable Sidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    15 days ago

    Last week I found the code for the first website I created, way back in the mid 90s. The server-side part was written in Perl.

  • ursakhiin@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    14 days ago

    PHP will never die. As long as code is written there will be PHP developers there to claim it’s good now.