upvote
My main worry with PHP is that its surface constantly grows. This means the language is

1. more complex to use (it took years for some parsers to implement the PHP 8.4 property hooks, and I suppose few people can explain how they work with inheritance and traits), 2. more costly to maintain (I remember when the developer of PHP's JIT left, the PHP foundation was worried because no one could understand the JIT code), 3. and has more security risks (critical security releases will continue).

I don't disagree with you, but the situation is more nuanced, and PHP's initial promises are now blurred.

> 1. A stateless functional core. It's cheap to run and quick to start.

Most modern codebases use a framework. And once you have to load Wordpress, Drupal, or even worse, Laravel, then it's no longer cheap and quick. So PHP added several layers of complexity to mitigate this: an opcode cache, a code-preload system...

> 2. Every request has an environment created then torn down.

That's no longer always true. When the code preload is enabled, a request can leak into another.

> 3. Every request is single-threaded. [...] Async network/IO requests are handled via extensions.

You mixing up two different things. The default PHP SAPIs have single-threaded request handlers (though IIRC the default deploy stack of Laravel differs). But the language has a native async feature through Fibers, from which coroutines can be implemented (see amphp/amp).

So PHP on the server side is usually like JS on the client side (except for workers): single-threaded with async. Though I haven't seen much use of Fibers in the wild, it's in the language.

reply
> once you have to load Wordpress, Drupal, or even worse, Laravel, then it's no longer cheap and quick

The frameworks aren't slow: https://tideways.com/profiler/blog/php-benchmarks-8.6-vs-8.5...

reply
From your own source, a basic demo with Laravel peaks at 95 requests/s/core. It's worse with Wordpress at less than 20 r/s/core. That's slow.

The last round of TechEmpower web benchmarks computed the framework overhead. Depending on the task, the performance of Laravel was 5% to 20% of the native PHP code, i.e. 5 to 20 times slower. Source : https://www.techempower.com/benchmarks/#section=data-r23&tes...

reply
It would be nice if you could request that unused parts be disabled. Maybe in the first line of your file.
reply
> That's no longer always true. When the code preload is enabled, a request can leak into another.

That's in the same bucket (to me) as, say, L1/2/3 cache leaking between CPU threads. That's resulted in real attacks but it's not really the fault of my programming. I would rather the bug be in the language or the compiler/interpreter or even the framework because it's more likely to get found and fixed than if it was only code written by me for me.

As an aside, PHP eliminates a whole class of bugs that don't exist in, say, C/C++ eg string buffer overflows. Yes, the PHP engine can itself have buffer overflows but as per my previous point I trust the library developers and the volume of people who use and analyze it more than being totally correct with my own string handling.

> But the language has a native async feature through Fibers, from which coroutines can be implemented (see amphp/amp).

Only a single fiber runs your PHP request at any one time. This still fits the same model.

reply
As they say, there are two kind of programming languages: the ones people complain about and the ones no one uses!
reply
Some ancient languages have massive usage for historical reasons, but it doesn't mean we should use them for new projects. COBOL is still heavily used in US finance system, it doesn't mean it's a good choice for a greenfield financial system or enterprise application. PHP's situation is better than COBOL, but it's not the best especially for complex enterprise systems. I myself work on such system using PHP and I know what I'm talking about. Type safety kinda sucks, we heavily rely on PHPDoc annotations for complex types, still, in many places no guarantee that the returned thing will not be null, or the returned array is a normal array or a sparse array, or that array contains only integers, etc. It's really annoying. Arrays suck badly, why on earth I need some hybrid of a hash map and an array? And this is why it has so many issues. And why should this be true "0.1" == ".1" when 2 different strings are compared?
reply