using this particular version-numbering scheme, 1.01 is equal to 1.1 - I don't think that's a bug, because the version-numbers in this version-numbering scheme are integers, not decimals.
so I believe this is in fact as correct as it can be, since numbers like "01" should not really be used in this version-numbering scheme, as it's not an integer. changing it is probably not a good idea, since comparisons like "1.10" and "1.100" could potentially become really tricky - in the current version-numbering scheme, 100 is greater than 10, but if these were interpreted as decimals, they would be equal. looks like I opened up pandora's box with this one ;-) bottom line, I think, is that version_compare() should work for the version-numbering scheme used by PHP, so that it works for checking the PHP version-number. if you happen to use the same version-numbering scheme for your PHP projects, good for you - if you don't, too bad... there are just too many version-numbering schemes to support them all... On Sat, Jul 21, 2012 at 2:22 AM, Kris Craig <kris.cr...@gmail.com> wrote: > > > 1.01 eq 1.1 > > Could you explain this one to me? In every versioning system I've ever > used, 1.1 would be greater than 1.01, not equal. > > > On Fri, Jul 20, 2012 at 5:07 PM, Stas Malyshev <smalys...@sugarcrm.com > >wrote: > > > > > Hi! > > > > > > >> For example, I was not the only one who found it odd that "1.0" is > > > >> considered less than "1.0.0" - wouldn't it make sense to "pad" the > > > shortest > > > >> version-number with zeroes? e.g. "1.0" if compared against "1.0.0" > > > would be > > > >> padded with zeroes at the end, e.g. as "1.0.0". > > > > > > 1.0.0 and 1.0 are different things. If you want to make a comparison > > > that takes into account only two components, you can just cut them both > > > to two components, then compare. > > > -- > > > Stanislav Malyshev, Software Architect > > > SugarCRM: http://www.sugarcrm.com/ > > > (408)454-6900 ext. 227 > > > >