Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81007 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91174 invoked from network); 23 Jan 2015 00:22:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2015 00:22:23 -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:35771] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/F5-61273-43491C45 for ; Thu, 22 Jan 2015 19:22:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 71F2FB0007B; Thu, 22 Jan 2015 19:22:09 -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 ZXk8AJBs86K3; Thu, 22 Jan 2015 19:22:09 -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 1EB36B00085; Thu, 22 Jan 2015 19:22:07 -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:22:04 +0000 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <544E77F3-2DB7-4A4C-BCAC-3440D990AC2D@ajf.me> References: <53F8A1FF-C809-4DDF-9C6F-6916C3E4F044@ajf.me> To: Yasuo Ohgaki X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Combined Comparison (Spaceship) Operator From: ajf@ajf.me (Andrea Faulds) Hey Yasuo, > On 23 Jan 2015, at 00:07, Yasuo Ohgaki wrote: >=20 > Ruby has it. Semantics is the same. > http://ruby-doc.org/core-1.9.3/Comparable.html >=20 > PERL has it. Semantics is the same. > = http://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity Yep, and I mentioned as much. It=E2=80=99s also in Groovy, but it=E2=80=99= s not as well-known a language. > Python has similar "<>", but it only compares equality. (the same as = !=3D, > !=3D=3D) Actually, PHP also has <> (as do one or two other languages). I think = it=E2=80=99s a relic of BASIC, which had =3D for equality and <> for = inequality. I don=E2=80=99t think it=E2=80=99s used terribly much by the = user base. > MySQL has it. Different differs. It's for NULL comparison. > = http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#operator_= equal-to Yeah, I=E2=80=99m aware of that. I think this is the one case that might = cause confusion, since MySQL and PHP are used together so often. The = manual could have a note on it, I suppose. > There is no reason not to have it, it seems. > I suggest to add Ruby/PERL operator link to the RFC. Good idea, I=E2=80=99ve done that now (I chose a slightly better link = for Perl). I=E2=80=99ve also linked to the Wikipedia article about the = operator. > I would like to name it other than T_SPACESHIP. There=E2=80=99s a case for that possibly=E2=80=A6 I don=E2=80=99t think = the fancy name hurts much. The syntax error output includes the token = name, and it has the same name in some other languages. It wouldn=E2=80=99= t be like Paamayim Nekudotayim, which is a name PHP and only PHP has = ever used.=20 Thanks. -- Andrea Faulds http://ajf.me/