Hacker News new | ask | show | jobs
by wvenable 2591 days ago
> What is PHP's concurrency model? Is it still a forked process pool via something like PHP-FPM, or has it changed? > Does the VM enforce a GIL? I'm assuming there is some kind of threading API?

As far as I'm aware PHP is still mostly run PHP-FPM. It also does have a threading API: https://www.php.net/manual/en/class.thread.php

> But I was ignorant. Honestly, after switching to Python for web dev, I saw no reason to ever return. Since then, I've dropped web dev altogether, and I now work in C++, Java, and Python on a daily basis.

I haven't done PHP seriously in a very long time. I currently work in C# and ASP.NET for web and I do C++, Python, and JavaScript. Personally, I'm doing work in Python right now and I don't enjoy it very much -- I'd much rather work in PHP for web development over Python. I prefer a good strongly typed language.

> I still cringe at the thought of using PHP again after learning how capable other general purpose languages are. From a CS point of view, working in PHP just isn't very interesting... or pleasant.

I don't know. PHP has Lambdas. It has generators. It was strong typing. From a CS perspective, there isn't much PHP does not have for the purposes of web development. It's limitations, in my opinion, mostly come from being a dynamic scripting language but those same issues befall Python and Nodejs as well.

If I had to code in PHP again, my code wouldn't look much different from my code in any other language.

1 comments

That's fair.

I think if you're building CRUD apps over and over again, then yeah, there isn't too much difference.

But if you're building a web service with more complicated business logic and you need more control over your concurrency model, then other languages look more appealing.

And it looks like PHP doesn't have JIT yet, which is another huge mark against it.

So PHP is probably fine for passing params and rendering back HTML. But anything sitting in between that's more interesting should be built in something else.