Re: common issue with version_compare()
| From: | Ángel González | Date: | Mon, 23 Jul 2012 15:29:35 +0000 |
| Subject: | Re: common issue with version_compare() | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61648@lists.php.net to get a copy of this message | ||
On 22/07/12 04:08, Kris Craig wrote:
> On Sat, Jul 21, 2012 at 3:09 AM, Andrew Faulds <ajfweb@googlemail.com>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.1 are essentially the same thing.
No, it is not.
> 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.
It's the first time I hear about a project writing 1.0.1 as 1.01
> The Gitflow model reserves that last digit for hotfixes. However, many
> developers (including myself) drop the second dot as it's pretty much
> superfluous. Maybe that's an American thing, I dunno. But having 1.1 ==
> 1.01 would cause this function to be completely and utterly *worthless *for
> many developers like myself.
It doesn't matter that you bump the minor or revision number, it's up to
each
project what should increase on a change of X severity. It would still
work flawlesslly
as far as you do it consistently.
If you release 1.0.1, 1.02, 1.0.3 and expect it to order that way, it
will fail. And I guess
that so would many developers too.