Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61614 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96208 invoked from network); 21 Jul 2012 10:09:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2012 10:09:12 -0000 Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:46707] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/A0-27309-6CF7A005 for ; Sat, 21 Jul 2012 06:09:11 -0400 Received: by wgx1 with SMTP id 1so3415141wgx.11 for ; Sat, 21 Jul 2012 03:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RTlnOsR0b899I7zMYWXpc/B5P7Uwyg4BdJNStm6fYag=; b=qIqHVp9lfbeAVDTPdWhdGQUsgJpeyWVHqPDh8arutjJrcJuB591AwfOJdIPVCg3vyS bFr2W/XOwB88dsrlp+tn+TGEDd8OL2ksfC/ll7GwK+25wtXizDwjPy4k1p0chYQpgbKW Yr1AJNrdlWNTKIkYCJFlTrfC4pqfJp2akzsQ04Oed9ZfRM5EFcr4oh7ecgRvAQ3gwnl7 qJu6X8TrZeUA4uPnGLg34wlVXtjmSOoG+rOcmAVzgMkrSx+5MzZcjpzosQkVq6oH4dEX 6l7UjWZVhtFzTCzpg+Q/c86nue61miWdkwFWMX7oLCLfQZJ+23XRRxODCUbRArX9GuZI mlPQ== MIME-Version: 1.0 Received: by 10.180.100.37 with SMTP id ev5mr13871038wib.5.1342865348358; Sat, 21 Jul 2012 03:09:08 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Sat, 21 Jul 2012 03:09:07 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Sat, 21 Jul 2012 03:09:07 -0700 (PDT) In-Reply-To: References: <5009C8AA.10603@sugarcrm.com> Date: Sat, 21 Jul 2012 11:09:07 +0100 Message-ID: To: Tjerk Meesters Cc: "internals@lists.php.net" , Kris Craig , Rasmus Schultz Content-Type: multipart/alternative; boundary=f46d041826d611f2b204c554340b Subject: Re: [PHP-DEV] common issue with version_compare() From: ajfweb@googlemail.com (Andrew Faulds) --f46d041826d611f2b204c554340b Content-Type: text/plain; charset=UTF-8 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 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 comparisons (until you reach major version 10). > > > > >> 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 > >>>>> 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 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. > >>> -- > >>> Stanislav Malyshev, Software Architect > >>> SugarCRM: http://www.sugarcrm.com/ > >>> (408)454-6900 ext. 227 > >>> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d041826d611f2b204c554340b--