Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70097 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72600 invoked from network); 10 Nov 2013 22:51:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2013 22:51:33 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:52390] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/00-06236-4FD00825 for ; Sun, 10 Nov 2013 17:51:32 -0500 Received: by mail-wg0-f41.google.com with SMTP id n12so985455wgh.4 for ; Sun, 10 Nov 2013 14:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=br34Wccm5+E7IXoMF1p5PTTsJHUJJ6ueU9ZCoNVZ270=; b=Rf45SL/YobrKskkaCGAn5261U2+xYE9yawGDKJ3ABWZLfLe4fwvsB04en4aBewyDqo AIB/cdhiQ2V9J50V1kX0yT06/ijoa8bEl8yhZlfbv7wWX4gZpwJ8F/29urPT+XeZtOOf JAW4LJthQQ2mSxQ/M8mrGhkRhDMAAiWqUcLhFHOq7ZoJckjdVHWdMkTU4JaZdSxXCQP4 OpFu9Z5X81Jtwj5ZCysNZvxIt5sd3voQnYJhdOijnbAIQ/7XuTI9ciaAL607ib2hswLD SDIkCTRfZ1UTqd1+E5uvLg0i/LSY/9bL4X0FNMfaLWxwXCgXce1trdmWGlLIPpLD1TgQ nDjA== X-Received: by 10.180.93.137 with SMTP id cu9mr10030437wib.40.1384123889640; Sun, 10 Nov 2013 14:51:29 -0800 (PST) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id ll10sm28363167wic.9.2013.11.10.14.51.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Nov 2013 14:51:28 -0800 (PST) Message-ID: <52800DEF.5020802@gmail.com> Date: Sun, 10 Nov 2013 22:51:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: internals@lists.php.net References: <527DF228.1080108@sugarcrm.com> <527F3B9B.8040006@sugarcrm.com> <527F5A95.1030601@sugarcrm.com> <527FE213.3000101@gmail.com> <1742604024.20131110145925@cypressintegrated.com> In-Reply-To: <1742604024.20131110145925@cypressintegrated.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Comparison and conversion inconsistency - need more info From: rowan.collins@gmail.com (Rowan Collins) On 10/11/2013 19:59, Sanford Whiteman wrote: > ( -1 < true ) // false, because the two compare equal and the comparison must return a bool > > ( min( -1,true ) ) // -1, because the two compare equal and -1 was passed first > > ( min( true,-1 ) ) // true, because the two compare equal and true was passed first > > Absolutely consistent with documentation. > > Pay attention to the final return type of a simple comparison vs. > comparisons wrapped in the min() function. > > -- S. > > Thanks, I thought there was probably an obvious explanation. Effectively, they're equal, so which of them is lower is "undefined"; min() made one assumption (whichever came first), my dummy function with < made the other (whichever came second, because it fell into the else{}). -- Rowan Collins [IMSoP]