Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61561 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35827 invoked from network); 20 Jul 2012 12:40:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 12:40:40 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:55843] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/B1-18983-7C159005 for ; Fri, 20 Jul 2012 08:40:39 -0400 Received: by vcbgb30 with SMTP id gb30so2387669vcb.29 for ; Fri, 20 Jul 2012 05:40:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=Om8pQ7f2Xjk/CjCbSsMmyqHUInKh8RzlZtEfzMJ8588=; b=gBvrYVY+++CritsloOU0haK56s6QXH28wyMWxxr9nnDabhmLIwTEUw/Z9UbRqxQK+p MUgIv4kwBjA4p0AtUxi3Y5udAV7aaxIi1DXcvr/LZm2XFpsyXOQd7HVK/Y6oJE8D1jsy JTMf1k/i4RwaXDo8KiNhvZELzwOqsySzjgbnTbTldlu34iSOA82ZFgXgMf4gBxouatP/ z+Vkk3fkeIXFuUxL68hqOWExTvrlU13HjN1HEAMmTP0jWUZIjCT4g3/TKL6AkoIVhV4g sfCrVnYA7VLafT/xI84U9rkIzQ7qej+VEJzO2tMoHJ103A653KbPWxmj2kyA+I/8zkmO 1Ayw== MIME-Version: 1.0 Received: by 10.52.176.66 with SMTP id cg2mr3722598vdc.121.1342788036398; Fri, 20 Jul 2012 05:40:36 -0700 (PDT) Received: by 10.52.92.82 with HTTP; Fri, 20 Jul 2012 05:40:36 -0700 (PDT) Date: Fri, 20 Jul 2012 08:40:36 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf307f34baeb101004c542334b X-Gm-Message-State: ALoCoQlW3Cb3Zij8vCG7KKqhhtEnWxyeblmZ4SQ9AoNYrOWQzzWZ4Dcsrz+mgIGlrde9xdDC6lgp Subject: common issue with version_compare() From: rasmus@mindplay.dk (Rasmus Schultz) --20cf307f34baeb101004c542334b Content-Type: text/plain; charset=ISO-8859-1 From the comments in the documentation, it seems others are having the same problem with version_compare() that I was running into: http://us2.php.net/version_compare Look at all those code-samples and "extensions" to the function - I found it very odd that the documentation does not explain how an "empty" version-number is interpreted compared to the strings and numbers, which are clearly defined and explained. 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". Of course that would break backwards compatibility, which kind of defeats the purpose of having a standardized version-number comparison standard. But as you can see, people aren't using the function as-is anyway - they're writing their own... - Rasmus Schultz --20cf307f34baeb101004c542334b--