Hacker News new | ask | show | jobs
by odder 16 days ago
What is their stance on breaking existing code?

I was testing some PHP ~5 code in 8.3 and there was some questionable backwards compatibility decisions. eg methods that previously returned true / false to indicate success now threw errors, same message signature and all.

1 comments

PHP is EXTREMELY backwards-compatible in general. All breaking changes are (i.e. were up to this point) usually introduced very gradually, first emitting Notices and Warnings and not without a very good reason.
For a certain value of "gradually". Whether it's too fast or not comes down to opinion (and some of the changes themselves come down to a difference of opinion on how a given language feature "should" work), but it's the reason so many old sites are stuck on PHP5 - because it's not fully backwards-compatible.

A poster phrased it well on here recently¹: "in general lots of users being on unsupported releases should also cause some reflection why that is. E.g. maybe support periods are too short or there are too many breaking changes with new releases."

¹ https://news.ycombinator.com/item?id=50194270

> the reason so many old sites are stuck on PHP5

Right, and you surely mean 5.3, not 5.4. There is a difference between "extremely backwards-compatible" and "not breaking anything ever", you know. I converted (gradually, through each major release, of course: skipping versions indeed would be more difficult) huge ancient codebases from pre-5.3 to 8.* just fine, and there wasn't even LLM to help me back then. It wasn't that hard. PHP never introduced anything close to Python 2 vs Python 3 situation.

Obligatory xkcd, wrt legacy support: https://xkcd.com/1172/