8 ms·
Upvoting, because the issue at hand is so old that I find it funny people will use this as a reason as to why "PHP sucks". For the record, the version in quest
by josegonzalez 14y ago
Upvoting, because the issue at hand is so old that I find it funny people will use this as a reason as to why "PHP sucks".
For the record, the version in question was 5.3.1 vs 5.1.6, two releases away and three years apart. Of course you'll need to test updates to your app with such version changes. Yes, using semver means this is a minor version release, but if we do that, I'll be first to note the lovely hash syntax changes in Ruby 1.9.
In any case, the current release is 5.4.4.
- rurounijones 14y agoSorry I couldn't grok what your opinion on semver was. Ruby 1.9 introduced new hash syntax but did NOT break the existing syntax one so it was a minor version release (backwards compatible). PHP made an backwards incompatible change in their code so it should have been a major version increase. So as far as I can see Ruby is in the right and PHP is in the wrong with regards to adhering to semver. Is that not your opinion?
- deleted 14y ago[deleted]
- josegonzalez 14y agoThe following does not work anymore in 1.9 (at least when it was released, who knows if they reverted the change): {"a", "b"} And there were plenty of gems and small scripts online I was able to get working just fine under 1.8.7 but not 1.9. Thankfully that is largely no longer the case, as things have been updated or replaced. String class was also given a nice kick in the ass, at least in regards to iteration. Would you say that these were not backwards incompatible changes? Code that worked before stopped working. Breaks BC in my book. And in both cases the changes were arguably for the better. - Stop writing code with uninitialized variables - Stop iterating over stuff that shouldn't be iterated over in that way As far as why the changes were thus, it was decided to destroy PHP 6 - do people still write books about that? - and port every change other than unicode support down to 5.x. Someone feel free to correct me on that point.
- petercooper 14y agoIt doesn't work in the latest 1.9 either. It was a bizarre syntax that hardly anyone used from my experience (I've been a library-oriented Rubyist for several years and never saw it in production code.) However, String is a good point, and especially around character encodings. Not to mention threads, major stdlib changes, enumerators, and more..
- piggity 14y agoI don't "really mind" if it breaks totally (i.e. throws an appropriate exception or doesn't parse the syntax check). I find it much more irritating when the behaviour subtly changes and introduces edge cases that may not be picked up in testing / normal usage.
- josegonzalez 14y agoPassing in an empty string to a function that states it takes float as it's argument is certainly an edge case the developer should have thought of.
- masklinn 14y agoThe again, in PHP, interpreting strings as floats is not unusual and pretty well defined. So in PHP it's also a case the developer could have considered normal in his expectation that PHP would behave as usual (and it did, prior to 5.3, for this precise function)
- methodin 14y agoNot for user-provided input. That's just a dumb thing to do in any language.
- masklinn 14y ago> Not for user-provided input. Not what for user-provided input? The source of a string does not matter to this rule of PHP: a string used in numeric context will be parsed and converted, if it can not be parsed as a number its numeric value will be 0. That's it. That's how the language defines strings in numeric contexts. > That's just a dumb thing to do in any language. Sure, you won't get any argument from me on that, but that remains how PHP works and has always worked.
- gurkendoktor 14y agoSomewhere around Ruby 1.8.6, the stdlib Digest::MD5 syntax changed without any explanation that I know. In one patchlevel of 1.8.6, they've added a check against creating new Ruby objects while the GC is running (I hope I remember this right), breaking all SWIG extensions at once. Ruby 1.8.7 changed the C extension API, I think? I'm not sure if 1.8.7 broke the old one or if 1.9 did. Ruby 1.9 broke "when 5:" in case statements. Files also started needing "# Coding: UTF-8" comments. And then there are subtle changes that probably aren't even documented, like [Math.sin 0] not being valid syntax anymore. Block variable scoping and automatic splitting into Arrays is different. Ruby 1.9.2 (!) changed the way require() works and added require_relative() which is impossible to properly backport. And Ruby 1.9.3 fixed a parser bug again, breaking code that worked on 1.9.2. (I think you could have a superfluous "do" in one place.) Those are the breaking changes that I can remember from first-hand experience now, only the last one is second-hand over IRC. And this is excluding Rake, Rubygems and all the other crap that breaks at every other git commit. Ruby is a bad example.
- josegonzalez 14y agoI used it as the example simply because it is normally a language that is touted quite superior to PHP. I think it is better in some regards - building/using Ruby DSLs is awesome - but not all. Languages are subject to bugs. If they didn't have bugs, people wouldn't complain.
- iamumassthrower 14y agoHahaha. People wouldn't complain. That's a knee slapper.
- sirclueless 14y agoNo more preposterous than software without bugs.
- josegonzalez 14y agoAt that point I'd start making fun of your username ;)
- petercooper 14y agoIt doesn't matter anyway. Semver is just a practice and not one everyone has or must sign up to, especially in its official form. Further, you're right about Ruby 1.9's hash syntax, although in the interests of accuracy, it's more accurate to consider it an additional syntax. It certainly doesn't replace the existing one (indeed, hashes notated in the new style get returned in the old style with #inspect) and I don't believe there are plans to ever remove the standard syntax.
- tedunangst 14y agoWhy would you expect PHP releases to adhere to rules that some guy threw together? Especially considering PHP has about a decade of history using the numbering scheme they do use.
- regularfry 14y agoNeither Ruby nor, as far as I know, PHP follow semver. Historically all bets have been off when it comes to breaking changes on "minor" releases.
- zem 14y agoare people really looking to this as a reason why php sucks? i thought the point of the post was to mock the "bug" reporter and his clueless sense of entitlement.