4 ms·
Surprisingly enough, PHP is a good example of environment that doesn't break backward compatibility much. About the only change that had a significant impact o
by dexen 7y ago
Surprisingly enough, PHP is a good example of environment that doesn't break backward compatibility much.
About the only change that had a significant impact on projects I worked on was removal of the 'mysql' DB extension (replaced by 'mysqli' and 'PDO'). For an older project I created a few shim functions and it still works just fine.
While frameworks come and go, the core of the language is highly backward compatible. The choices made early on were in the UNIX style, so they were right.
To quote an earlier post[1],
--
There is something to be said about PHP's staying power. The early versions of the language weren't considered "right". Except maybe they were right for the problem at hand.
The way I see it was PHP captured the vector of change, and left ample room for future developments. Both internal changes (hello, bytecode; hello, JIT), language level features (hi there, namespaces), and runtime level features (oh hai, countless built in classes and functions).
Moreover, unlike many framework that shone brightly and burned out quickly (Rails?), PHP captured the essence of the environment: HTTP is stateless, and URLs aren't uniformly routable from either end, and well-formed HTML/XML/JSON is just a subset of tag soup.
Worse is better.
--
[1] https://news.ycombinator.com/item?id=19536132 https://news.ycombinator.com/item?id=19536132
- dannypgh 7y agoIf your timeframe goes back to PHP4, this most certainly isn't true. Just one glance of https://www.php.net/manual/en/reserved.keywords.php https://www.php.net/manual/en/reserved.keywords.php should prove this - every new keyword is a backwards incompatible change. And I mention this because I used to support software that used, as a variable name, something which became a reserved word...
- lowercased 7y agoas a variable name, wouldn't it have been prefixed with $ ? the XML parsing was probably the biggest BC change I hit between 4 and 5.
- dannypgh 7y agoI think I'm misremembering and they were method names. I believe it was clone, in fact.
- yoavm 7y agoCan't relate with that... I'm still hosting some WordPress websites for clients from a few years ago. I'm afraid to upgrade PHP versions because many things broke in the past. True, it's not the WordPress core but the plugins that usually break, but I can't think of a single client of mine that doesn't have at least 3 plugins installed.
- merlyn 7y agoDitto. I just did a project upgrading hosted websites to the latest PHP from PHP 5.6. These are already sites that vetted past the obvious issues of the mysql and mcrypt APIs going away, and these sites were all maintained in at least the last 4 years (I host sites that haven't been touched for over a decade, they aren't getting upgrades). Even with these "cherry picked sites", we had about a 30% failure rate dealing with the new PHP. Ranging from total non-function of some random CMS, to mostly errors printing all over every page due to some deprecated or change of code behavior in the site templates.
- chx 7y agoNowhere on the level of Python 2 to 3 but every minor version upgrade of PHP breaks Drupal core (and some contrib as well) one way or another. It's OK, we love the new features :)