Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61581 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7149 invoked from network); 20 Jul 2012 21:08:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 21:08:00 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.113 smtp113.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.113] ([67.192.241.113:34381] helo=smtp113.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/AE-18983-EA8C9005 for ; Fri, 20 Jul 2012 17:07:59 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp11.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 52C5FD05DA; Fri, 20 Jul 2012 17:07:55 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp11.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 12946D0433; Fri, 20 Jul 2012 17:07:55 -0400 (EDT) Message-ID: <5009C8AA.10603@sugarcrm.com> Date: Fri, 20 Jul 2012 14:07:54 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Rasmus Schultz CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] common issue with version_compare() From: smalyshev@sugarcrm.com (Stas Malyshev) 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