Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94399 invoked from network); 21 Jul 2012 09:53:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2012 09:53:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; 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:43241] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/50-27309-C2C7A005 for ; Sat, 21 Jul 2012 05:53:49 -0400 Received: by wgx1 with SMTP id 1so3409352wgx.11 for ; Sat, 21 Jul 2012 02:53:46 -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=S/TJvJo1ZkG1ghlxtJW9ZOmub66y32Kqp2TJ6YWoVlk=; b=L81VMIHUIsJ001xkXvCeLdErqzO08RiaqApe4vIV/8ssp3UIvloLMRpMJ4xVAUiEvg TRiu38H0QS24zI9VcDAgtdWaOBSlc3KcMjg3r3MW3Jh7eHMYAdlD5QlrvFZSHWc1Gq+U GXBcfldW2SKHmFVi1ZgiXyCld/cZ8AVsBma137fcbja70mw4n8ZDjEjeGZz4cDt/RupQ 1ETP5DQZrWYarId953B7c2FTIhRR6tr9mu6mXuls4pD3lgSLqrbDZuMOGWZFbDG1tBWw axxYvthdRSwzYJ2uHHscg5RAvhu8ATlXmK6HUIjj5yzESYNWEFstwZCVsa/ICZG2kvA0 qh3w== MIME-Version: 1.0 Received: by 10.180.76.135 with SMTP id k7mr32717559wiw.7.1342863928452; Sat, 21 Jul 2012 02:45:28 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Sat, 21 Jul 2012 02:45:28 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Sat, 21 Jul 2012 02:45:28 -0700 (PDT) In-Reply-To: References: Date: Sat, 21 Jul 2012 10:45:28 +0100 Message-ID: To: Pierre Joye Cc: internals@lists.php.net, Rasmus Schultz Content-Type: multipart/alternative; boundary=f46d043c7e926fe4bf04c553df83 Subject: Re: [PHP-DEV] common issue with version_compare() From: ajfweb@googlemail.com (Andrew Faulds) --f46d043c7e926fe4bf04c553df83 Content-Type: text/plain; charset=UTF-8 To follow that up, this is how version numbers are sorted: 1, 1.0, 1a, 1.0.1, 1.0.1a, 1.0.1.1, 2, 2.0.1 The first number is always most significant, followed by each number after it (not necessarily single digits, ReactOS has 0.3.14 for instance), then finally any letters at the end. Equivalence is obvious: if a version (e.g. 3) is compared to one with more numbers (e.g. 3.0.3), zeros are added until same: 3.0.0 vs 3.0.3. Now see comparison rules. On Jul 21, 2012 10:32 AM, "Pierre Joye" wrote: > hi, > > No, I mean version with 1.0 and not 1.0.0 are not. They are just not > correct and confusing, as you noticed. > > On Sat, Jul 21, 2012 at 11:19 AM, Andrew Faulds > wrote: > > What? x, x.y, x.y.z, x.y.z.a, etc are all valid. > > 1, 1.1, 1.1.2, 1.1.2.3, in that order, would be valid. > > > > On Jul 21, 2012 10:07 AM, "Pierre Joye" wrote: > >> > >> hi! > >> > >> On Fri, Jul 20, 2012 at 2:40 PM, Rasmus Schultz > >> wrote: > >> > >> > Of course that would break backwards compatibility, which kind of > >> > defeats > >> > the purpose of having a standardized version-number comparison > standard. > >> > >> x.y.z is standard, x.y not. I keep asking package maintainers to use > >> x.y.z as version and not x.y. > >> > >> Cheers, > >> -- > >> Pierre > >> > >> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > >> > >> -- > >> PHP Internals - PHP Runtime Development Mailing List > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > > > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > --f46d043c7e926fe4bf04c553df83--