Re: common issue with version_compare()

From: Date: Fri, 20 Jul 2012 22:22:30 +0000
Subject: Re: common issue with version_compare()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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 reason for something like this that i can come up with
is that, for whatever reason, a project wants to change from
two component version numbers to three component ones right after
having done a 1.0. And in that case a 1.0.0 following the 1.0
would be a new release, even if it only differs by the extra .0

And so 1.0 < 1.0.0 would be perfectly correct.

-- 
hartmut





Thread (21 messages)

« previous php.internals (#61583) next »