Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81008 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92619 invoked from network); 23 Jan 2015 00:24:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2015 00:24:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:41343] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/56-61273-FB491C45 for ; Thu, 22 Jan 2015 19:24:32 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 4F8EAB00085; Thu, 22 Jan 2015 19:24:29 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YKh88vkUb-Ov; Thu, 22 Jan 2015 19:24:29 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 29E98B0007B; Thu, 22 Jan 2015 19:24:27 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Fri, 23 Jan 2015 00:24:25 +0000 Cc: Larry Garfield , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <8858EE5D-7472-41F7-9C38-091043100ABF@ajf.me> References: <53F8A1FF-C809-4DDF-9C6F-6916C3E4F044@ajf.me> <3251D635-D97C-4738-B537-935A6CC21E19@ajf.me> <54C17E2B.80708@garfieldtech.com> To: Yasuo Ohgaki X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Combined Comparison (Spaceship) Operator From: ajf@ajf.me (Andrea Faulds) Hi Yasuo, > On 23 Jan 2015, at 00:16, Yasuo Ohgaki wrote: >=20 > Hi all, >=20 > On Fri, Jan 23, 2015 at 7:48 AM, Larry Garfield = > wrote: >=20 >> The examples say nothing about mixing types, though. Eg, what would = these >> return: >>=20 >> return 0 <=3D> "0" >>=20 >> return "" <=3D> 0 >>=20 >> return 1 <=3D> [1, 2, 3] >>=20 >> Ignoring object property names and going by the order of the property >> definition seems like asking for trouble, too. >>=20 >=20 > It should be the same as '=3D=3D=3D', IMO. > Only the same type should return 0. > Object has the same id should return 0. > Arrays would be matter of discussion. Having it be the same as =3D=3D=3D would be inconsistent with our = existing sorting and comparison behaviour, so I don=E2=80=99t think it = should be changed. If we made it strict like that, we=E2=80=99d also = have to define a strict < and > as well, otherwise we have a problem, = because in some cases ($x !=3D=3D $y && !($x < $y) && !($x > $y)) is = TRUE. Thanks. -- Andrea Faulds http://ajf.me/