PHP dev since 5.0 here. I think the severity of these breaking changes is overstated.
I’ve been able to keep several large business-critical projects up-to-date for years, even up to PHP 8.3, with little to no breaking changes encountered.
PHP 8 didn’t really break adding properties to objects dynamically, it just deprecated one bad-practice way of doing so. I remember worrying about this before upgrading, across my entire project with 40+ Composer direct dependencies, there were zero instances of this deprecated approach being used.
With other breaking changes there’s plenty of notice given (years, even). You can control where and how deprecation notices are logged, there really shouldn’t be any surprises at upgrade time.
“Old PHP” made it easy to write buggy or unpredictable code. Modern PHP feels more like writing TypeScript vs JS, there’s real safety and a much better developer experience now. PHP is having a resurgence for good reason, yes, it’s (marginally) harder to keep up with, but with proper tooling (PhpStorm, phpstan, etc.) the DX is leaps and bounds ahead of where it used to be.
I thoroughly enjoy writing modern PHP. I don’t have to worry about the language doing unpredictable dynamic type casting unless I want it to explicitly. The flexibility of old PHP is still there, but it’s much harder to shoot yourself in the foot accidentally.
I think you missed my main point: That people are different.
I have not doubted that there are people who like the more rigid structure which the current maintainers push for. I actually mentioned that.
But the success of PHP comes from the people who like PHP the way it was. Empowering them to write their own web projects with the least amount of code and bloat.
> But the success of PHP comes from the people who like PHP the way it was
I'm sure that was the case for many years, but I believe the successful resurgence of modern PHP is coming from the people who want to see PHP actively improving. Not those who like PHP the way it was!
PHP got a nasty reputation thanks to things like the "Fractal of Bad Design" site. Modern PHP has resolved (effectively) all of those early critiques.
The ongoing success of PHP comes from it continually improving :)
Where do you see ongoing success? That people still maintain old PHP projects? That is what I said - maintaining old code is done by people who are paid for it and like rigid structures.
But people who build the future rarely use PHP now. Look at jobs at YC startups:
It is rare to see PHP mentione anywhere. It's mostly Python and JavaScript now.
Look at how lean Python's syntax is compared to PHP's new obsession with "public static function {}" insida a \namespace\which\is\not\needed\when\you\have\a\module\system tagged as "#[AllowDynamicProperties]". None of that is needed in Python:
And look at how backward compatible JavaScript is. You still can run code from 20 years ago just fine.
The fractal of bad design post resonated with people who are paid to code. Who have to adhere to "best practices" and who don't mind spending time on bureaucracy. All makers I know just shrugged it off with "None of that get's in my way".
I’ve been able to keep several large business-critical projects up-to-date for years, even up to PHP 8.3, with little to no breaking changes encountered.
PHP 8 didn’t really break adding properties to objects dynamically, it just deprecated one bad-practice way of doing so. I remember worrying about this before upgrading, across my entire project with 40+ Composer direct dependencies, there were zero instances of this deprecated approach being used.
With other breaking changes there’s plenty of notice given (years, even). You can control where and how deprecation notices are logged, there really shouldn’t be any surprises at upgrade time.
“Old PHP” made it easy to write buggy or unpredictable code. Modern PHP feels more like writing TypeScript vs JS, there’s real safety and a much better developer experience now. PHP is having a resurgence for good reason, yes, it’s (marginally) harder to keep up with, but with proper tooling (PhpStorm, phpstan, etc.) the DX is leaps and bounds ahead of where it used to be.
I thoroughly enjoy writing modern PHP. I don’t have to worry about the language doing unpredictable dynamic type casting unless I want it to explicitly. The flexibility of old PHP is still there, but it’s much harder to shoot yourself in the foot accidentally.