What's the logic behind version_compare() thinking that 1 < 1.0 < 1.0.0? Talking about the versionning world, to me look quiet obvious that all these should be equivalent. If PHP 5.0 is released the next release won't be 5.0.0, will be 5.0.1 intead.

That could lead in problems with software dependecies, because I'd need to know the amount of "digits" the next version will have for setting the exact dependency on it. This is, I can't set a dep in PHP6 to greater or equal than 6.0.0 because probably it would be 6.0 or even just 6. I'd need to set the dep to "6" if want to cover all the cases and doesn't look very clear for a normal user.

Test cases:

$ php -r "var_dump(version_compare('1', '1.0'));"
int(-1)
$ php -r "var_dump(version_compare('1.0', '1.0.0'));"
int(-1)


Tomas V.V.Cox


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to