Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4762 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66817 invoked by uid 1010); 8 Oct 2003 13:25:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66793 invoked by uid 1007); 8 Oct 2003 13:25:34 -0000 Message-ID: <20031008132534.66792.qmail@pb1.pair.com> To: internals@lists.php.net Date: Wed, 08 Oct 2003 15:23:03 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 81.202.136.39 Subject: version_compare(): 1 != 1.0 != 1.0.0 From: cox@idecnet.com ("Tomas V.V.Cox") 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