Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61600 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69067 invoked from network); 21 Jul 2012 06:22:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2012 06:22:38 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:50791] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/16-18983-CAA4A005 for ; Sat, 21 Jul 2012 02:22:37 -0400 Received: by qcmt36 with SMTP id t36so3002355qcm.29 for ; Fri, 20 Jul 2012 23:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=76q1j7VJzkCQdnHVjv3qcGZysntub3ubS94woGDRcXI=; b=f9LFeNPACnElYMGdkAOuioGx9PLTRpe2AjHQWctmRC4mfSnf62TNTOTbQE3UbOcsFN J2mRqM6hHIUaBDVf8QCR4wq9mimpd3B2ZPON3PimoiYs936u9gyDKYQHm5SAU8tn+eHP W7dqPzGrxGM3/t19Qrti3vgQDgkZLons++GWblY5W8Oyu9bkYJYLXHO0J/Y+dzUqcrV1 3BgOHZOjynjgvodm574RgAGNCq/58givb1F1nHl6BW4EYyyC2Y6pPvZVCqGIjhqmeTJ9 LuedIQhs4NDwohc0D4upb5/jPCHtAlJv17NfrCOvw1KQarpZspZILymFwid/BB3tbMnz qG0A== MIME-Version: 1.0 Received: by 10.224.180.146 with SMTP id bu18mr13990574qab.10.1342851753393; Fri, 20 Jul 2012 23:22:33 -0700 (PDT) Received: by 10.229.85.204 with HTTP; Fri, 20 Jul 2012 23:22:33 -0700 (PDT) Received: by 10.229.85.204 with HTTP; Fri, 20 Jul 2012 23:22:33 -0700 (PDT) In-Reply-To: References: <5009C8AA.10603@sugarcrm.com> Date: Fri, 20 Jul 2012 23:22:33 -0700 Message-ID: To: Rasmus Schultz Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=485b397dcfcdbf3f8d04c55109b8 Subject: Re: [PHP-DEV] common issue with version_compare() From: kris.craig@gmail.com (Kris Craig) --485b397dcfcdbf3f8d04c55109b8 Content-Type: text/plain; charset=ISO-8859-1 > 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. > 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 > > --485b397dcfcdbf3f8d04c55109b8--