Re: [PHP-DEV] common issue with version_compare()

2012-07-23 Thread Ángel González
On 22/07/12 04:08, Kris Craig wrote: > On Sat, Jul 21, 2012 at 3:09 AM, Andrew Faulds wrote: > >> If you think 1.1 =/= 1.01 you're sure using some weird version numbers. >> Only 1.0.1 would be smaller. >> >> Has anyone seen these weird version ordering schemes in practise? On any >> major projects

Re: [PHP-DEV] common issue with version_compare()

2012-07-22 Thread Lester Caine
Kris Craig wrote: *raises his hand* 1.01 and 1.0.1 are essentially the same thing. If a versioning model doesn't utilize the second dot (many don't), then 1.01 would be the same as 1.0.1 in a project that does use it. The Gitflow model reserves that last digit for hotfixes. However, many deve

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Kris Craig
On Sat, Jul 21, 2012 at 3:09 AM, Andrew Faulds wrote: > If you think 1.1 =/= 1.01 you're sure using some weird version numbers. > Only 1.0.1 would be smaller. > > Has anyone seen these weird version ordering schemes in practise? On any > major projects of note? > > *raises his hand* 1.01 and 1.0.

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Rasmus Schultz
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 thi

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
Maybe it should have an optional extra parameter specifying comparison "mode"? (I.e. version formatting) On Jul 21, 2012 1:08 PM, "Ángel González" wrote: > On 21/07/12 11:32, Pierre Joye wrote: > > hi, > > > > No, I mean version with 1.0 and not 1.0.0 are not. They are just not > > correct and co

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Ángel González
On 21/07/12 11:32, Pierre Joye wrote: > hi, > > No, I mean version with 1.0 and not 1.0.0 are not. They are just not > correct and confusing, as you noticed. Then Linux 2.6.39 shouldn't have been followed by Linux 3.0 For me, 1.0 and 1.0.0 are the same thing. It's fine if x.y is not a valid "PHP-

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
If you think 1.1 =/= 1.01 you're sure using some weird version numbers. Only 1.0.1 would be smaller. Has anyone seen these weird version ordering schemes in practise? On any major projects of note? On Jul 21, 2012 10:51 AM, "Tjerk Meesters" wrote: > > > On 21 Jul, 2012, at 2:22 PM, Kris Craig w

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
To follow that up, this is how version numbers are sorted: 1, 1.0, 1a, 1.0.1, 1.0.1a, 1.0.1.1, 2, 2.0.1 The first number is always most significant, followed by each number after it (not necessarily single digits, ReactOS has 0.3.14 for instance), then finally any letters at the end. Equivalence

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Tjerk Meesters
On 21 Jul, 2012, at 2:22 PM, Kris Craig 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. Because 01 is just a padded version of 1, probably used to make it easier for regular string compari

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
1, 1.0, 1.0.0, 1.0.0.0, 1.0.0.0.0 etc. are not confusing, they are completely correct, and all mean the same thing. If I publish MyApp v1, v1.0 and v1.0.0 are the same. On Jul 21, 2012 10:32 AM, "Pierre Joye" wrote: > hi, > > No, I mean version with 1.0 and not 1.0.0 are not. They are just not >

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Pierre Joye
hi, No, I mean version with 1.0 and not 1.0.0 are not. They are just not correct and confusing, as you noticed. On Sat, Jul 21, 2012 at 11:19 AM, Andrew Faulds wrote: > What? x, x.y, x.y.z, x.y.z.a, etc are all valid. > 1, 1.1, 1.1.2, 1.1.2.3, in that order, would be valid. > > On Jul 21, 2012 1

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
What? x, x.y, x.y.z, x.y.z.a, etc are all valid. 1, 1.1, 1.1.2, 1.1.2.3, in that order, would be valid. On Jul 21, 2012 10:07 AM, "Pierre Joye" wrote: > hi! > > On Fri, Jul 20, 2012 at 2:40 PM, Rasmus Schultz > wrote: > > > Of course that would break backwards compatibility, which kind of defeat

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Pierre Joye
hi! On Fri, Jul 20, 2012 at 2:40 PM, Rasmus Schultz wrote: > Of course that would break backwards compatibility, which kind of defeats > the purpose of having a standardized version-number comparison standard. x.y.z is standard, x.y not. I keep asking package maintainers to use x.y.z as version

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Andrew Faulds
Yeah, that would definitely be a bug. On Jul 21, 2012 7:23 AM, "Kris Craig" 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 >wrote: > > >

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Kris Craig
> 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 wrote: > > > Hi! > > > > >> For example, I was not the only one who found it odd that "1.0" is > > >> conside

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Rasmus Schultz
> 1.0.0 and 1.0 are different things. I think the problem is, version numbers are different things to different people - I guess the documentation maybe isn't clear enough on precisely what version numbering scheme it's using. To most people, "1" and "1.0" are the same thing, because they look lik

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Simon J Welsh
On 21/07/2012, at 10:22 AM, Hartmut Holzgraefe wrote: > On 07/20/2012 11:07 PM, Stas Malyshev wrote: >> 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. > > it is ha

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Hartmut Holzgraefe
On 07/20/2012 11:07 PM, Stas Malyshev wrote: > 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. it is hart to imagine a 1.0 followed by 1.0.0 in real world, but the only

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Stas Malyshev
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

Re: [PHP-DEV] common issue with version_compare()

2012-07-20 Thread Andrew Faulds
Well, in the spirit of PHP, let's make version_compare_fixed()! On Jul 20, 2012 1:41 PM, "Rasmus Schultz" wrote: > From the comments in the documentation, it seems others are having the same > problem with version_compare() that I was running into: > > http://us2.php.net/version_compare > > Look