Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unfortunately, the current maintainers of PHP have not learned from the success of it. And are driving PHP into the direction of having the rigid structure that Java has.

It is so successful because people who build new things are different from people who are paid to maintain old things. That is why WordPress, Wikipedia and countless other successful internet projects have been created using PHP and not using Java.

People who build new things like simplicity and elegance and tools that empower them. While people who are paid to maintain old things like a rigid structre which gives you the feeling of "nothing can go wrong".

Also, people who build and run things do not like breaking changes of their stack. While people who are paid to maintain old things don't care about breaking changes in their stack. Because they are paid to then work around those changes.

In the last version (8), PHP has introduced a ton of breaking changes which makes the language more rigid. And therefore less useful to build new things and more cumbersome to maintain:

It broke the order of parameters in join statements.

It broke calling static functions without the need to declare them as static.

It broke adding properties dynamicly to objects.

It broke easy string handling for many functions where null was rendered as an empty string. This is especially annoying as you often get null values from the database. It makes sens to have a value for "Don't know the color of the car" in the DB. And it makes sense to render it as "Color: " in the user interface. The easy string conversion always was one of the strengths of PHP. Why is it sabotaged now?

Some of these changes have been objected to by the original developer of PHP and long standing contributors like the author of xdebeug, PHP's most popular debugger. Yet they have been implemented.

The big danger is that this trend continues and existing PHP projects will be choked to death by more and more breaking changes. Changes which have to be worked around by making the code of the projects more and more bloated.



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:

https://www.ycombinator.com/jobs

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:

https://www.online-python.com/Da8nQUlAEp

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".


This move toward a more rigid and static typing pushed me to move to Java (which also pays more). After 15 years of PHP and over 5 in Java, I wouldn't go back now.

For a one-off script, I might still use a bit of PHP, if I didn't have javascript.


Wow, and here I was complaining that they are fixing the language too slowly…


Tacit acceptance of backwards-incompatibility is a pandemic in our industry, it was only a matter of time before PHP was infected.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: