Remix.run Logo
hu3 3 days ago

> In short, the modern PHP ecosystem gives us the best of both worlds: the ability to build quickly and confidently in PHP, while still having powerful options (C, Rust, Go) for performance-critical parts. This hybrid approach lets us stay productive without sacrificing speed where it matters most.

I understand this for a large codebase where rewriting is not feasible.

But if that wasn't the case, a C# APIs achieves both speed of development and execution in my experience. You'll rarely need to reach for C++ or Rust.

PHP is great but the language still doesn't allow things like typed arrays. It will happily accept string in a array of dates, for example.

ThinkBeat 3 days ago | parent | next [-]

Having been in the C# world for a long time, and the various web/api frameworks.

PHP is really nice if you dig into it, it includes so many great functions and functionality built in for creating web stuff.

It also has a number of issues,. but to quikly put something together PHP take the win in my limited opnion.

mircerlancerous 2 days ago | parent | next [-]

Completely agree. I don't work much in PHP anymore, but there's still nothing that's faster or easier to get something up and running. I use it for web services, and command line scripts when I just need something fast.

DoctorOW 2 days ago | parent | prev | next [-]

To give an example, my main website is C#, I love it from a dev perspective and performance perspective. But I also have PHP on my personal server and will knock out PHP scripts for one off demo projects. I just ssh into my server, `vim projects/example.php` and it's instantly deployed as a link I can share.

hu3 2 days ago | parent [-]

There's `dotnet run` now. You can:

vim projects/example.cs

    var builder = WebApplication.CreateBuilder(args);
    var app = builder.Build();
    app.MapGet("/", () => "Hello World!");
    app.Run();
dotnet run projects/example.cs

Not the same as PHP I know, but it's close enough for me.

DoctorOW 2 days ago | parent [-]

I'm glad it works for you but I guess that doesn't really cover the use case I was talking about because I want to have a bunch of these. As an example, I threw together a quick web hook processor, data from one service reformatted to fit another. I don't really need to spin up a whole new VPS for an endpoint that'll only be hit once or twice a week, so this is the workflow for doing that on the server I already have.

PHP:

   - vim projects/webhook.php
C#:

   - vim projects/webhook.cs
   - Assign a port number
   - Reconfigure Nginx/Caddy to serve that port number
   - Reconfigure systemd to dotnet run projects/webhook.cs on startup
reactordev 2 days ago | parent | prev [-]

The only reason PHP still exists is because of shared hosting companies and Wordpress.

PHP’s initial appeal was you could do scripting on the server side, “turn off PHP with a ?>” spit out normal html, and “turn back on PHP with a <?php”.

For a beginner programmer, it was simple, easy to understand, and had an include so your designs were’t nested table hairball messes of garbage. (but your CSS was definitely garbage).

Today, it’s so easy to run JavaScript, I can build a basic jsx site in under an hour, just like I can with PHP and includes. With Bun, I can quickly write a data access layer as well and wire up crud APIs w/ JWT auth. A weekend project in both.

hnlmorg 2 days ago | parent | next [-]

PHP might have a bad reputation but I honestly don’t think JavaScript is a better language in real world terms.

I do get why JS appeals to people, but switching from PHP to JS feels a little winning an internet argument — you might feel smarter for doing so but in reality all you’ve done is sunk time into something that doesn’t make you any better off.

tialaramex 2 days ago | parent | next [-]

There's a firm foundation in Javascript. The choices aren't choices I'd make but they're choices I understand. Brendan Eich knew what he was doing and it shows, indeed if it was made simply of bailing wire and string it'd have been replaced.

For PHP on the other hand - even when I started writing PHP3 - so certainly not the very beginnings, it's clearly just cobbling together whatever works from unrelated half-understood parts and so there's no coherent centre to it, when I last worked on some PHP earlier this year it still felt like bailing wire and string.

hnlmorg 2 days ago | parent | next [-]

The JavaScript invented by Eich is nothing like the clusterfuck that is the modern JavaScript ecosystem. And modern node.js code will look nothing like the JavaScript Eich developed for Mozilla.

Equally, PHP3 is worlds apart from modern PHP.

Your point is a little like saying “motorbikes are easy to maintain because they’re based on the penny-farthing”. Times have changed and your references are literally decades out-of-date.

zelphirkalt 2 days ago | parent | prev [-]

Do we need to post that JS' weird things link here? Of the basics of JS, few things are sound. The "firm foundation" idea doesn't really work for JS. It might even work better for PHP, and I am saying that as someone, who doesn't want to do PHP ever again.

com2kid 2 days ago | parent [-]

JS is very much a minimal language that has a handful of choices. E.g. arrays being objects with field names that are sequentially numbered integers.

The initial equality operator was a mistake, but that was rectified over a decade ago with `===`. Not having a proper int type sucks and holds the language back in a number of ways, but otherwise the language is wonderfully regular.

And anyone who complains about the ecosystem has obviously never tried python, which after a decade of attempts, is now almost on par with JS of a decade ago!

hnlmorg 2 days ago | parent [-]

You shouldn’t compare backwards.

Saying “at least x isn’t as bad as y” doesn’t further a discussion, it only acknowledges denial about just how bad the problems are with x.

This is particularly true when we weren’t even discussing y (in our case, Python) in the first place.

austhrow743 2 days ago | parent | prev | next [-]

What if the context isn't that you're switching from PHP though? What if the choice is to stick with Javascript for the full stack, or to also learn PHP on top of Javascript?

phplovesong 2 days ago | parent | prev [-]

JS is basically just a comp target as of 2025. If PHP devs used something like Haxe they would be amazed how safe their programs would be. But i usually just see slop instead.

freedomben 2 days ago | parent | prev | next [-]

I'm not a huge fan of PHP, but for simple sites I think you way underestimate the power and simplicity. It feels old compared to jsx approach, but old doesn't always mean bad. I've increasingly returned to the template rendering model pioneered by PHP and for sites that aren't full blown apps, it is a lot simpler which means faster iteration and reduced cognitive load. I think you really have to decide based on the complexity you need

sublinear 2 days ago | parent [-]

> I think you really have to decide based on the complexity you need

I don't really agree. I think the goal should be to reduce complexity where possible, but not if you're inevitably painting yourself into a corner.

If you want the simplest and most scalable way forward, write static pages and avoid server-side rendering.

zelphirkalt 2 days ago | parent [-]

How would you be painting yourself into a corner with PHP more than with JS? If you use PHP, you can just serve/use JS later. But if you use JS, you will have a hard time serving HTML from PHP later. Aside from both languages kinda being painting oneself into a corner, I don't see how one would do more so with PHP than with JS, out of all the things.

reactordev 2 days ago | parent | next [-]

The issue is, if I’m using JS, why on earth would I ever use PHP? I can just await file('index.html') or return <IndexPage>

The cognitive load is null. You’re just having trouble breaking apart your learned behavior. Returning a component of jsx is just the same as writing an include for PHP.

zelphirkalt 10 hours ago | parent [-]

So if returning a component is the same, how would one (PHP) be more painting oneself into the corner than the other (JS)?

sublinear 2 days ago | parent | prev [-]

I'm coming from the perspective of real world business concerns, not hobby projects.

It's inevitable that you will need to host the pages somewhere else like a CDN to lower latency, integrate with other backends, and the biggest one is allowing the frontend devs to have complete control of the HTML so that stylesheets and javascript don't randomly break for reasons out of their control. They should be able to develop everything locally with mocks instead of your server and use whatever build tools and frameworks they want. There are also SEO and accessibility concerns with the page structure. The backend devs should not be making decisions about any of that. Sometimes the client may want quick turnaround on simple but very specific changes to the pages. None of that process should depend on backend teams who don't care and will drag ass about it because they will have to refactor their junky code that hasn't been touched in years.

Getting rid of dependencies and having good boundaries in the code that align with the way dev teams are organized is always a good thing. I'm not sure why anyone would go for SSR unless they haven't done web dev in a while or are working on a legacy project. Even if this starts out as a hobby project, you need to keep things clean for future maintainers.

zelphirkalt 10 hours ago | parent | next [-]

I find it quite presumptious to assume, that backend developers do not care about this or that, or that they "drag ass about it".

To me it rather sounds like what you describe are code monkeys that give zero pushback on back engineering decisions, and will jump at anything that marketing throws in front of them. We have way too many of that kind already, making the web a dystopian version of what it should be.

And let me tell you, I am mostly doing backend things, as all the hype in the frontend world is offputting, but when I do frontend things, I don't do half-assed things. I make websites more responsive than 95% of "responsive" websites that we find these days as passing for that, most of which are developed by frontend developers, unsurprisingly. This is because I don't subscribe to the hype and solve responsiveness issues using web standards and CSS.

Just the other day I enhanced a couple of pages in a platform I am building, so that they can be used entirely without JS, while they are polling the backend API. Nothing too complicated, simply taking precautions on the backend side for enabling those pages to be reloaded and rendering updated state, and avoiding reloading them triggering new unwanted duplicate actions in the backend. How rare it is, that I see frontends going to that length of putting in some minimal effort, to make their websites more accessible and privacy friendly. Where are all those great web developers?

As I see it, a good developer with good knowledge about the basics of web development, most importantly HTML and CSS, only secondarily JS, can build better sites than most of what we see on the web today. The current mainstream is clearly not working all that well.

Why one would go for SSR? Because it doesn't require ones users to run untrusted JS. Because it doesn't require every single client to rerender the same things over and over again. Because it is lighter on the client. Because often it needs less data transferred, because there is no frontend framework whose code needs to be sent. Because it does not require repairing browser functionality after breaking it. There are many reasons to choose SSR. Also I will note, that you can do SSR and separate the logic for rendering your pages from your other code, so that the SSR accesses only API routes. Then others can build alternative frontends for that API.

reactordev 2 days ago | parent | prev [-]

I agree with all of that except for SSR part. SSR is back, like it’s 1996. However this isn’t your old school monolith serving jsp pages with tag classpath hell, this is client side pages served from the server for faster rendering. We now have another layer.

Browser -> Client-Side Server Pages -> Business Logic APIs -> Backend Systems.

const_cast 2 days ago | parent | prev | next [-]

PHP has a much more competent type system than JS and is overall more ergonomic IMO.

Typescript exists, but if I'm compiling something I'm using a real language or framework like dotnet. There's no reason for me to use typescript and node and install 100 packages when I can just install dotnet.

reactordev a day ago | parent [-]

install dotnet, and install 100 packages for .net core, asp.net, identity, ef, etc. Don’t kid yourself.

While strongly typed languages are great. I like to be able to get things done. This is why I don’t C++ anymore. This is also why I don’t dotnet anymore. Too much BS with the type system and correctness and the Microsoft way or lack of support or rug pull. They lost me when they killed XNA.

Typescript is actually good, except for the fact that it’s a transpiler to JavaScript. That part sucks.

I want a C++, with Types, with memory safety, with garbage collection, with pointers, with a dev experience like dotnet, but we don’t have those things.

const_cast 18 hours ago | parent [-]

dotnet is a batteries included framework... It has way more included than any other language, including JS and PHP.

> I want a C++, with Types, with memory safety, with garbage collection, with pointers, with a dev experience like dotnet, but we don’t have those things.

Dotnet, you want dotnet. Dotnet has all of those. Yes it has pointers.

monooso 2 days ago | parent | prev [-]

> The only reason PHP still exists is because of shared hosting companies and Wordpress.

Unfortunately I can't think of anything constructive to say about this nonsense.

> Today, it’s so easy to run JavaScript, I can build a basic jsx site in under an hour, just like I can with PHP and includes.

You assume people agree that it's preferable to work in JavaScript.

phplovesong 2 days ago | parent | next [-]

Sadly this is true. From PHP websites 95% is wordpress/drupal/<cmstool>

k_roy 2 days ago | parent | prev [-]

And still nobody outside of Meta cares about hack.

The niche I think PHP had back in the day has largely been supplanted by Python.

Maybe it’s better now, but after moving on from it to basically anything else after a 25 year career, I don’t miss it.

monooso 2 days ago | parent | next [-]

I'm not sure what point you're trying to make by mentioning Hack.

At this point it's diverged from PHP to the point that it's basically a different language, is (IIRC) actually slower than PHP 8, and the HHVM doesn't even support PHP any more.

As such, it's not a huge surprise that relatively few people outside of Meta give it much attention.

I also moved on from PHP several years ago, and don't miss it. That doesn't mean I don't recognise that there are still perfectly legitimate reasons to choose it.

k_roy 2 days ago | parent [-]

Yep.

And meta/hack is probably the other huge mainstay of PHP outside of what the person you responded to said. And hack with HHVM was supposed to be the panacea for PHP

Just saying.

What people used to use PHP for tasks, has largely been replaced by Python.

timeon 2 days ago | parent | prev [-]

> And still nobody outside of Meta cares about hack.

Because everyone is OK with PHP. I'm not even using it directly but most of the web runs on it.

phplovesong 2 days ago | parent [-]

Not PHP, but wordpress.

jofla_net 2 days ago | parent | prev | next [-]

>It will happily accept string in a array of dates, for example.

Yeah theres a bunch of oddities that rear their head from time to time.

I've had one peculiar JSON de-serialize bug lately that really threw me for a while. I normally do the json_decode() with the second arg set true, which yields an assoc arr. This doesn't tell the whole story though. IF the key is numeric when decoding, PHP will make its key an int! and not a string like the rest. I'm guessing it does the equivalent of an is_numeric() check or something.

This yields an array with keys which could be ints and strings :/

Still for all its warts though it is a fantastically Frankenstein of a language!

honorary-hickup 3 days ago | parent | prev | next [-]

> It will happily accept string in a array of dates, for example

While completely true, you are using static analyzer anyway which won’t let you do this.

The generics support will likely come in the near future, there has been momentum in it again: https://thephp.foundation/blog/2025/08/05/compile-generics/

s1mplicissimus 3 days ago | parent [-]

I'm working in PHP for about 15 years by now, and for about 10 of them I was promised generics. In favor of your health, don't hold your breath.

avan1 2 days ago | parent | prev | next [-]

Author here. thanks for reading my post. actually you still don't need rewrite. running php with workers (swoole, frankenphp, ...) may be as fast as node. and for typed array php has static analysers like phpstan. it support generics and typed arrays with typed comments.

newuser94303 2 days ago | parent | prev [-]

I would never use a Microsoft language since they discontinued VB6. Open Source languages are the only sane option.

mrsmrtss 2 days ago | parent | next [-]

And you are not using Typescript either, because it's a Microsoft language? Also .NET is open source over a decade already and c# was free and open from the beginning (Mono implementation).

chairmansteve 2 days ago | parent | prev [-]

C# is open source.