Hacker News new | ask | show | jobs
Learn PHP in 2026 (Yes, Really) (fagnerbrack.com)
40 points by shantnutiwari 11 days ago
15 comments

Please, if you want to persuade me, do it yourself. If you don’t believe in it enough to go through the effort to write the article, and instead ask an LLM to do it, it’s not going to convince me.
Some of us have been working with php for 22 years at this point and frankly I think Doctrine is the best ORM period.
What makes it so good? Genuinely curious
It uses a DTO style mapping system and central factory EntityManager making unit testing a breeze. Model definitions let you map database primitives directly from the models. It will automagically build you the table on first use and it's capable of moving data from one engine to another engine on the fly. Migrations are built in and it's capable of generating migrations directly from changes to a model. It's smart about SQL multi saves (transactions), joins for relationships, views, and a bunch of other database features that most ORMs don't even bother to be even aware of let alone implement. It's basically an enterprise level ORM. Functionally it works like ActiveRecord but under the hood it's very different.
Have you used Django's ORM?
The first time I heard the name Django was like 15 years ago in college so I'm sure I've used it by hosting some project for one reason or another over the years. Python is just not my go to. Also I maintain my own framework in PHP entirely so that's what I pull off the shelf when I wanna do CRUD.
I wish AI slop blogs would get banned with extreme prejudice. I guess there's a YC company that makes AI slop blogs, so it won't happen?
I'm not so sure that it's full AI. Might have used it to clean up, but she does seem to want us to believe that it isn't.

[0] https://www.linkedin.com/in/fagnerbrack/

That LinkedIn overview is also written by AI
LinkedIn, that platform where everyone wrote AI slop by hand before there was AI?
Possibly. She’s very much a self-marketer. I just figured that it was a good idea to link to the person.

I have found it useful to see the people behind the words, before accusing them of being bots.

But that does beg the question of what, exactly, is “AI slop”? If someone uses it like they would use an editor, to clean up their own prose, does that mean it’s “slop”? Editors have been placing a “corporate stamp” on words for hundreds of years. You always know when an article was placed in The New Yorker, or Harper’s Bazar, because the editor would make sure that the prose matched their style.

We’re really just at the beginning of this journey.

BTW: I’m not saying it wasn’t fully-generated AI prose, but I’m uncomfortable with “knee-jerk” accusations. I have seen some examples of misfires, when it comes to that.

In my professional career I've used Python, Ruby, TypeScript, Groovy, but in personal projects I always go with PHP. I'm just more productive with it. And I don't use all of the modern niceties of PHP, I use it exactly like it's still 2010. In my opinion, the dislike towards PHP stems from the same love for complexity that gave us all of the FP-obsession from roughly 2010-2020 (Scala, Clojure, F#, etc.)
I use it for my backend stuff. Robust, fast, safe, well-supported. Has all the right bells and whistles.

I never liked the language, but it does what it says on the tin.

I have found, in the project currently under development, that LLMs give very good PHP code. Better than mine, and I’ve been using it for 25 years. I don’t mind admitting that. PHP isn’t my main language (Swift is, and I’m still better than the LLM, for that).

I’m the same way, even for little side projects at work. Basic old-school PHP is effortless to setup and maintain on a server. It just works. This means my little side project can remain a little side project, instead of become a burden with a bunch of unnecessary complexity that modern frameworks introduce.

Anytime a hello-work tutorial starts with running a command that generates 50 boilerplate folders/files, I die a little inside.

What's your web server? To connect PHP with nginx you need a bunch of arcane configuration.
I generally just use Apache. A classic LAMP setup, if a DB is needed for anything. If no DB is needed, I guess it’s just LAP

This is pretty quick and painless to setup. SLES had a single command for it back when I used it, if I remember correctly. I currently have a simple Ansible playbook for it on RHEL.

It’s certainly much more straightforward than deploying Flask to production, especially if just using the default document root and not getting into virtual hosts.

I thought about going to nginx once, but as I started looking into it, I had to stop myself and ask why, as Apache was more than adequate for what I was doing, I had no issues with it in the past, and the setup was dead simple. It would be change for the sake of change, and seemed more annoying to boot, to your point.

Do you have any concerns about performance? The original reason nginx displaced Apache was to replace a thread-per-request model with an epoll state-machine model. I think Apache now supports the latter, though? In the age of AI scraping, you probably don't want to be prematurely pessimizing.
That’s not really an issue for me. I use this setup for small internal stuff. It might have 300 users at most, and they aren’t making constant requests. I run it on a small VM and only run into issues when someone dumps in so much data that PHP runs out of memory, which isn’t an Apache issue. And that memory issue doesn’t take down the site or server, it’s just the one request that dies. That used to happen maybe 5 times per year and was almost always due to user error (they screwed up something to end up with that much data in the first place). Some things changed and that particular tool is gone, so there should be no more issues with that.

I think a lot of people build everything assuming it will be the next Facebook, when it’s not. This leads to a lot of complexity in the name of potential future scale that never comes. For some, they are building the dream, but for an internal enterprise tool, mostly geared toward one team (which filtered out a little beyond into the org), I’m not worried about it.

The current setup has been running for 10 years now with minimal maintenance. Just moving it as needed to avoid EOL operating systems and platforms. For something that is a nice-to-have and never felt like a main deliverable for my job, this is ideal.

I almost rewrote it in python once, and planned to host that with nginx, but then I came to my senses.

I loved php came bundled with OSX, you just run php -s portnumber (iirc) as and you have a php enabled webserver running locally, so fun for experiments and super convenient especially compared to nowadays… i would prolly use Python, so make venv, activate, etc etc.
> you just run php -s portnumber

You can install PHP with homebrew or macports and still do this. I use it all the time.

https://www.php.net/manual/en/features.commandline.webserver...

Been using PHP for 20 years and have built multiple startups with it that went from ideas to exits.

Today's PHP is better than it has ever been. Are there some things that are rough around the edges? yes ofc. But there is no language that doesn't have that. It's all trade-offs.

Last week I switched from Nginx+FPM to FrankenPHP and my god even the deployment experience got 10x better.

Safe to say that if you haven't tried the language, give it a shot. Within a few days you'll know if it's a good fit for you or not!

FrankenPHP is really good but the reason perhaps PHP is left in the dust is that people reach for Typescript/Edge/Serverless hosts like Cloudflare

I personally blame Laravel for PHP's loss of relevance.

If anything, Laravel has been what has kept PHP relevant. The community (both PHP and Laravel) has continually grown year over year after the sharp decline of everyone’s poor experience with PHP < v5.0, and Laravel has clearly been responsible for that more than anything.
I perceived it to be more of a confusion over the paid/premium stuff which in hindsight wasn't that big of a deal but this highlights a precarious warning in that anytime one framework gets big enough and it muddies the boundaries between paid and free, it sends a signal to developers to look elsewhere.
If you are using an LLM to write code you should grab the strongest typed thing available in the domain/organization.. Rust, Scala, Typescript, F#, etc.
Here's a chart to replace the mockup with: https://w3techs.com/technologies/history_overview/content_ma...

According to this data (the same data referenced by WordPress marketing blog posts[1], if it's legit enough for them it's legit enough for me) WordPress usage across the web stopped growing almost all at once in 2021, with the beginning of a decline this year.

You can see an increase of other contenders (Shopify, for example) but of note is also None, which is probably related to how LLMs have been making it incredibly easy to deliver a website even without a CMS.

1: https://wordpress.com/blog/2025/04/17/wordpress-market-share...

In the chart yoy sent wordpress is growinf and "None" is declining. Am I missing something?
I'll restate what I'm seeing:

* WordPress remains roughly unchanged over the past five years, until the final datum which is lower than the flat trend.

* None had been decreasing but over the current year to date has increased sharply, correlating with the LLM trend and subjective notions of LLMs having "finally gotten good" for coding, though the trend is rather short.

* Over previous years, Shopify and Wix began to take increasing amounts of market share from WordPress as well as legacy competitors.

Because this chart shows proportions of the web rather than a total number of websites, and by virtue of remaining at the same proportion while the denominator increases, we know that the number of WordPress sites on the web is still increasing even if this is not clearly depicted by the chart. But I would argue the more important story is that WordPress is no longer eating the web as much as it is just consistent, and I think this shows that WordPress is now genuinely a little bit vulnerable as a singular platform choice to learn.

I don't disagree with the fact you had raised about fancy custom React SPA style apps being fairly rare in quantity across the web when so much of the web runs on whatever offering has a decent CMS and isn't too hard to deploy. And WordPress is still a great choice to learn today for those looking to make good money doing web dev, especially in freelance, marketing, e-commerce, etc.

But WordPress may actually finally be on the decline after holding steady after so many years, and having seen this data I would personally have come to a different conclusion than the one your post did.

Maybe I would have said something along the lines of "Despite the constant rumors of the death of PHP, WordPress has grown to serve nearly a majority of the websites on the internet and has held a steady chunk of the market for the last five years. Learning to use it is still many people's best chance at success in web development, even as other trendy technologies appear on the market. Even if WordPress were to significantly decline in popularity, a very large portion of the market for web development would continue to belong to those who chose to learn WordPress." I feel like that is still in the spirit of what your post intended, but with slightly closer alignment to some sort of data.

I use bunch of PHP files for personal/work stuff. Because the setup is very easy: just install nginx and enable php+fastcgi extension. Then just edit the files, no restart is needed. Also I don't need frontend and backend. Just echo html in php file :)
I need to figure out a way to detect the Medium logo and make my browser render a picture of a happy koala with a mug of coffee telling me to go find some other entertainment, because this ain't it.
The fact PHP finally has the features of other mature languages is just table stakes I guess?

IMO the article failed articulating what is PHP's unique selling point.

The argument seems to be that they think LLMs made the implementation languages equal or irrelevant, therefore PHP is as good as any of them now. The flip side of this argument is that PHP is not any more compelling than it was before, it's just adequate now that so many deficiencies have been addressed.
> There was no build step and no deployment pipeline. You changed a .php file. You refreshed the browser. The change was live. This was fast. It was messy. The language let you mix HTML and SQL in the same file. It did not stop you from writing spaghetti

Oh the smell! It's so obvious.

I wonder why though, why does every single AI write like this? There are barely any variance and everything looks exactly the same. Youtube, blogs, linkedin, it is so obvious that everyone is using the same thing, is this even model specific?

I've never been a fan of AI polishing my writings, but now I wouldn't even get it grammar checked. All of my writing that I expect people to read, particularly philosophy and rationale, are one shot stuff that came out of keyboard like this one.

I can believe it’s much improved and I wouldn’t look down on anyone for using it.

But it’s still never going to be a language I like, and I’m yet to encounter any of these modern codebases in the wild. It’s invariably a crusty old relic, much closer to the PHP of 2006 than the PHP of 2026.

Everyone is familiar with different things. As long as you can complete your work with the programming language you are familiar with, that's fine. As for which language to learn, it depends on personal interest
php has a decent standard library and the edit/reload workflow suits llms quite well but I wouldn't learn it if I didn't already know it in 2026
Isn't PHP's biggest selling point that you can ship fast?

Can you not ship fast with a much faster language right now using LLMs?

“false” === true because it’s not an empty string. It’s the same now that it used to be 10 years ago. The PHP equality operator is a meme, not even a joke
You're thinking of == which type coerces the non-empty string to boolean true.

PHP is not the only language that has this type of behavior.

It’s not the only language but it’s notorious for having the worst equality operator to the point where you are not even supposed to use == because it’s that awful
if("false" === true) echo "PHP sucks";

else echo "You're full of shit!";

// output

> You're full of shit!

Aside from the LLM smell, the most egregious thing about this article to me is simply implying that it's going to be much of a surprise to people that PHP has improved since the "fractal of bad design" days. The most popular Hacker News post that matches "php" in HN Algolia is this post from 2019:

https://stitcher.io/blog/php-in-2019

https://news.ycombinator.com/item?id=19917655

And while sentiment is understandably mixed even then, I actually think a lot of people have already come around on PHP as being "not as bad as it once was", if not even "good".

Some of its reputation, though, hinges not on out-of-date internet commentary, but instead on the fact that in practice a lot of the PHP code that's still in production today is simply legacy code and not up to modern standards, and most of the time when someone says PHP, they really mean that PHP. I think that is actually the thing that is holding PHP back hard outside of bubbles like HN. And honestly, even though I don't hate modern PHP, I don't have many codebases that come to mind when I think about modern PHP that are exemplary. I actually was relatively impressed with the s9e TextFormatter library used by phpBB3 when I looked at it, but even that is dated by today's standards.

Still, I think that PHP has an undeservedly bad reputation relative to other languages. I've recently come back into Python lately after having not really touched a ton of Python in a while and I gotta say, other than `uv` and `ty`, I don't feel a whole lot has improved in Python land. It's not that greenlets and gevent were fantastic or anything, but I thought it was satisfactory enough. Now that there's also asyncio, it feels like a nightmare trying to untangle old code and bring it into the async future... So many things just don't really work in this world, like old-school lazy fetching in SQLAlchemy. Python was most famous for the horrible Python 3000 migration, but so many years later and I'm not sure how much was really learned as reconciling greenlet and asyncio worlds feels like yet another Sisyphean task of trying to rebuild everything at once. OK, it isn't as bad, especially since you can at least wrap sync code into thread pools, but it definitely is an absolute PITA, and I feel like what we're getting out of it doesn't exceed what we're putting in.

So that's my thoughts. Internet commentary is probably no longer PHP's biggest enemy; instead, it's more like its own past successes. (And, also, the fact that we easily forgive the tools we use regularly for the faults that we have been used to for years.)