Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61612 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93093 invoked from network); 21 Jul 2012 09:51:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2012 09:51:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:55072] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/00-27309-19B7A005 for ; Sat, 21 Jul 2012 05:51:14 -0400 Received: by pbbrp12 with SMTP id rp12so8329885pbb.29 for ; Sat, 21 Jul 2012 02:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=0B0RHc41ssibX/nHrzK64Z2YS0zpO5XbsQCyb9uO2jA=; b=TFCyAvcG5Y6aLNPwDN/qOpYutQGf+HbP9SlhXMMI1I49kAnWBIklLYzjAGcJR+Qqc9 1GOZFhQ71CScgzBurd+d59eqaZafYzbANF56Im1ThITx4QaBAYWPiHtZjo78Z8CuetfE smHC/5WWYcFyYOyeEpujGKCyG9c5k/7SizQXotma7z+gPDYMky2lKimU32KU/4Wg4v19 uXFAg+i5R4m8Se5BmVYTM6KUQaRX8HYPazIMjlhsHfpxME8TeW+RyU9iSLtkACX4EEoB 19b+HfIoUekBcsnIWhPWfejUG2TNUs6QwfNnQJJmFQa00lhFXGNglljPeqlA7zO8mQ4t Tz0Q== Received: by 10.68.234.225 with SMTP id uh1mr20285241pbc.89.1342863969208; Sat, 21 Jul 2012 02:46:09 -0700 (PDT) Received: from [192.168.1.104] (bb42-60-29-211.singnet.com.sg. [42.60.29.211]) by mx.google.com with ESMTPS id sh3sm5761710pbc.16.2012.07.21.02.46.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jul 2012 02:46:08 -0700 (PDT) References: <5009C8AA.10603@sugarcrm.com> In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-ID: Cc: Rasmus Schultz , "internals@lists.php.net" X-Mailer: iPhone Mail (9B206) Date: Sat, 21 Jul 2012 17:46:05 +0800 To: Kris Craig Subject: Re: [PHP-DEV] common issue with version_compare() From: tjerk.meesters@gmail.com (Tjerk Meesters) On 21 Jul, 2012, at 2:22 PM, Kris Craig wrote: >> 1.01 eq 1.1 >=20 > 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 fo= r regular string comparisons (until you reach major version 10).=20 >=20 >> On Fri, Jul 20, 2012 at 5:07 PM, Stas Malyshev > wrote: >>=20 >>> Hi! >>>=20 >>>>> 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". >>>=20 >>> 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 >>>=20